
Get Short File Name in VBScript
ChrisB typed:
Quote:
> How do I get the Short File/Path name of a file or folder in
VBScript?
> If the path is C:\Program Files\My Company\My Program, is there a
> function I can call to get c:\Progra~1\MyComp~1\MyProg~1 ?
If you are dping this from WSH, FSO has everything you need. use the ShortPath
attribute (I assume this is a file):
Set FSO = CreateObject("Scripting.FileSystemObject")
Set f = FSO.GetFile( _
"C:\Program Files\My Company\My Program")
WScript.Echo f.ShortPath
If you don't have them already, you are going to find the docs very useful:
http://www.*-*-*.com/
crdoc56en.exe
--
Please respond in the newsgroup so everyone may benefit.
http://www.*-*-*.com/
----------
Subscribe to Microsoft's Security Bulletins:
http://www.*-*-*.com/