Windows Short Names for FilePaths

  • From: "RicksPlace" <ofbgmail@xxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Fri, 18 Mar 2011 17:57:12 -0400

Hi: I am trying to write a script, vbs, that will take a file path with spaces 
like c:\Program Files\.... and generate the short name (8.3)?
like c:\Progra~1\...
Do you have anything that works?I have been trying to use the WsShell run 
command and the Cmd /c ... to try out diferent options but I can't seem to get 
anything to work.The FSO.GetShortName, think that was it, will return the 
filename in the path shortened but not the other path names of the folders. 
There is something (dir /x)but I'm not sure how to use it in my script. Since 
this should be such a common thing to do when installing software or doing 
other system functions in a script I thought someone may have already found a 
technical that would work. I have to eliminate the spaces in the file path to 
try and do a insert for the gacutil utility. I want to point to my project 
folder, debug in the bin, in one of my vb.net projects to pick up the assembly 
- Phew! I have been at this for 2 or 3 days, they are running together now...
Thanks Rick USA 

Other related posts: