View Single Post
  #3 (permalink)  
Old 01-20-2007, 11:15 PM
Wesley Vogel
Newsgroup Contributor
 
Posts: n/a
Re: XP problem passing command arguments with spaces

What is WindowsXP file explorer? Windows Explorer (explorer.exe)?

What is a DOS window? Command.com? Use cmd.exe instead.

Use 8.3 names with no spaces or use quotes.

"c:\directory with spaces\test.txt"

You have to use quotes with some commands with cmd.exe, especially if the
path contains a white space.

<quote>
Remarks
Using multiple commands
* You can use multiple commands separated by the command separator && for
string, but you must enclose them in quotation marks (for example,
"command&&command&&command").

Processing quotation marks
If you specify /c or /k, cmd processes the remainder of string and quotation
marks are preserved only if all of the following conditions are met:

* You do not use /s.
* You use exactly one set of quotation marks.
* You do not use any special characters within the quotation marks (for
example: &<>( ) @ ^ |).
* You use one or more white-space characters within the quotation marks.
* The string within quotation marks is the name of an executable file.

If the previous conditions are not met, string is processed by examining the
first character to verify whether or not it is an opening quotation mark. If
the first character is an opening quotation mark, it is stripped along with
the closing quotation mark. Any text following the closing quotation marks
is preserved.

File and directory name completion correctly processes file names that
contain white space or special characters if you place quotation marks
around the matching path.

The following special characters require quotation marks: & < > [ ] { } ^ =
; ! ' + , ` ~ [white space]

If the information that you supply contains spaces, use quotation marks
around the text (for example, "Computer Name").
<quote>
from CMD...
Paste the following line into Start | Run and click OK...

hh ntcmds.chm::/cmd.htm

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In news:HyDsh.52648$z16.16221@newsfe10.phx,
Ron G <sellingforcash@cox.net> hunted and pecked:
> In a VB6 application, any file path with spaces that is passed from
> WindowsXP file explorer will not open in the application. I get a "File
> does not exist". Yet I can open that same file using a common dialog
> box in the application. I can also type the path as an argument from a
> dos prompt.
>
> MyApplication c:\directory with spaces\test.txt
>
> This works from a DOS window but if I double click on the file I get the
> "File does not exist". If I take the spaces out of the path it works
> fine. In window 2000 and before I did not have a problem. Something
> has changed in how XP passes arguments from the file manager.


Reply With Quote

 
Old 01-20-2007, 11:15 PM