Re: Windows Short Names for FilePaths

  • From: "RicksPlace" <ofbgmail@xxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Fri, 18 Mar 2011 20:24:30 -0400

Hi Martain and thanks! It worked like a charm. I must have mmissed the bloody propertieswhen browsing around the FSO object docs. I remember hitting the methods but... thanks again. It is always so simple when you know what you are doing.

Hope I'll get there some day.
Thanks again that is exactly what I think I can use in my attempt at using the gacutil app to copy my .net assembly from the Project's bin/debug folder into the gac during testing without moving things around manually. Actually it would have likely been easier in vb.net but I am taking Chuip's online class for Windoweyes scripting in VBScript so need to get up to speed with that, and related, technicals.
Thanks again!
Rick USA
----- Original Message ----- From: "Martin Slack" <m.g.slack@xxxxxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Friday, March 18, 2011 6:52 PM
Subject: Re: Windows Short Names for FilePaths


Hi Rick,

Have you tried ShortPath? ShortName will only operate on the filename, as you say. The following is from the VBScript reference, which can be downloaded from the Scripting part of the microsoft website:


Function ShowShortPath(filespec)
  Dim fso, f, s
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set f = fso.GetFile(filespec)
  s = "The short path for "   & UCase(f.Name) & "<BR>"
  s = s & "is: " & f.ShortPath
  ShowShortPath = s
End Function  hth, Martin

----- Original Message ----- From: "RicksPlace" <ofbgmail@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Friday, March 18, 2011 9:57 PM
Subject: Windows Short Names for FilePaths


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
__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: