Converting long file names to DOS format 
Author Message
 Converting long file names to DOS format

Hi everyone,

I'm trying to pass WScript arguments to a DOS program but my script fails
when the file has spaces in its name.  Is there any command in WSH to
transform file names with spaces into DOS format (Microsoft Office into
Micros~1, and Microsoft Visual Studio into Micros~2, etc.)?

Thanks,

DS



Thu, 02 Jan 2003 03:00:00 GMT  
 Converting long file names to DOS format
function ShowShortName(filespec)
{
   var fso, f, s;
   fso = new ActiveXObject("Scripting.FileSystemObject");
   f = fso.GetFile(filespec);
   s = "The short name for " + "" + f.Name;
   s += "" + "<br>";
   s += "is: " + "" + f.ShortName + "";
   return(s);

Quote:
}

--
Mark L. Ferguson    Please reply in Newsgroup
marfer's notes for OE 5 > http://www.geocities.com/SiliconValley/Bay/6386/IE_ng_notes.htm
Quote:

> Hi everyone,

> I'm trying to pass WScript arguments to a DOS program but my script fails
> when the file has spaces in its name.  Is there any command in WSH to
> transform file names with spaces into DOS format (Microsoft Office into
> Micros~1, and Microsoft Visual Studio into Micros~2, etc.)?

> Thanks,

> DS



Fri, 03 Jan 2003 03:00:00 GMT  
 Converting long file names to DOS format
set fso = createobject("scripting.filesystemobject")
DOS_path = fso.getfile("long file name here").shortpath
DOS_name = fso.getfile("long file name here").shortname

=-=-=
Steve
-=-=-


Quote:
> Hi everyone,

> I'm trying to pass WScript arguments to a DOS program but my script fails
> when the file has spaces in its name.  Is there any command in WSH to
> transform file names with spaces into DOS format (Microsoft Office into
> Micros~1, and Microsoft Visual Studio into Micros~2, etc.)?

> Thanks,

> DS



Fri, 03 Jan 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Converting Long File Names to Short File Names

2. Converting Long File Names to Short File Names

3. Converting Short File Names to Long File Names

4. Getting short file name from long file name:

5. Converting Paths having short name to long versions

6. Unzip a zip file to preserve long file name

7. Long File Names in ASP ... Convert with VBScript to Short File Names

8. using long file names?

9. Passing long file names to CMD.exe

10. Ghostscript supports long file names on WinNT?

11. CreatePath and Long File Names

12. Run remote batch and long file name.

 

 
Powered by phpBB® Forum Software