
Help Spaces in folder names
Quote:
>WSH has no problem showing and getting path information for folders
with
>spaces in their names. But the second I try to use WSH and run to
>start a program that is in a folder that has a space in the name it
>fails. Is this a problem with WSH or is there a work-around?
The problem is that when WSH sees the space, it thinks it is the end
of the command line and that all words after the space are arguments.
To make WSH see the entire string as one command, enclose the string
itslef it quotes. This gets a little tricky, because you already have
to put it in quotes to let WSH know it is a string. But the string
itself needs to have quotes too. In
VBScript, you can put quotes
inside a string by using a double quote ("") wherever one quote is
needed. Here's an example:
objShell.Run """C:\Program Files\test.bat"""
If you're using JScript, you can put the quotes in the string by
enclosing the string with single quotes, like in this example:
objShell.Run ('"C:\Program Files\test.bat"');
Another way to fix the problem would be to use the short file-name
(which wouldn't have spaces), but you'd have to go to the trouble of
converting the long file name to its short file name.
I hope this helps!
Good Luck,
Russell Davis