|
| | |||||||
| Windows XP Discuss the Microsoft Windows XP Operating System |
| | LinkBack | Thread Tools |
| |||
| XP problem passing command arguments with spaces 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. |
| |||
| Re: XP problem passing command arguments with spaces "Ron G" <sellingforcash@cox.net> wrote in message news:HyDsh.52648$z16.16221@newsfe10.phx... > 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. Surround your file names with double quotes, e.g. "c:\directory with spaces\test.txt". BTW, DOS is an operating system, like Linux or Windows. There is no DOS under Windows. I suspect you mean the "Command Prompt" when you write "DOS window". |
| |||
| 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. |
| Bookmarks |
| Thread Tools | |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Passing command line argument via Windows Shortcut | Peter Lu | Windows XP | 4 | 09-19-2007 02:25 AM |
| Passing command line argument via Windows Shortcut | Peter Lu | Windows XP | 0 | 09-19-2007 02:24 AM |
| Invalid Command Line arguments??? | Jenna | Windows Vista | 11 | 09-09-2007 03:50 AM |
| Passing Validation | Ray | Windows Vista | 2 | 06-26-2007 03:50 AM |
| Passing command line arguments | Cornel Gligan | Pocket PC General | 2 | 01-15-2007 10:53 AM |
| New To Technology Questions? | Do You Need Help with Your Computer or Device? | Do You Need Help with this site? |