>>Hi all,
>>
>>Is there a way in which i can use short path names instead of long path names throught justpath().
>>
>
>In the FAQ there's sample code that will use the Win32 API to convert a long name to a short name under Win32 and Other APIs. Alternbatively, you can use the Scripting.FileSystemObject's File or Folder subobject - both have a short name available as a member property.
>
>>That is, assume i have a folder called "FLD Caption" , this in DOS mode, would be "FLDCAP~1"
>>When i go thro justpath() , it shows "FLD CAPTION" and hence it is impossible to try and copy any files from this folder at runtime. This is cause it encounters a space between FLD and CAPTION, it considers it as invalid command.
>>
>>How do i get around this.
>>
>>Dinesh
If you put the path between " ", you should have no problem. If you use variables in the copy file command, add " " in the variable too.
This will not work :
dest = "c:\program files\test.txt"
copy file test.txt to &dest
But this will :
dest = '"c:\program files\test.txt"'
copy file test.txt to &dest
Remember you can use [ ], ' ' or " " as string start and end symbols.
Marc
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only