Re: XP problem with command line arguments with spaces
- From: "Alfie [UK]" <alfie@xxxxxxxxxxxx>
- Date: Sun, 21 Jan 2007 14:07:02 +0000
On Sat, 20 Jan 2007 22:18:32 -0800, Ron G <sellingforcash@xxxxxxx> wrote
something that piqued my interest enough to reply with:
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.
Typically you would put quotes around a long name to force it to be
passed as one element;
MyApplication "c:\directory with spaces\test.txt"
2K/XP command prompts (CMD32) are long name aware so do not need the
quotes normally.
Start->Run does not appear to be long name aware for the calling
application but will pass any args without mangling them whether they
are in quotes or not;
"c:\directory with spaces\MyApplication" c:\directory with
spaces\test.txt
"c:\directory with spaces\MyApplication" "c:\directory with
spaces\test.txt"
Depending upon how you are accessing the command line args you may or
may not see the quotes on the passed args.
As Bob posted, how are you handling the command line args in your app ?
--
Alfie [UK]
<http://www.delphia.co.uk/>
Choosing between two evils is still choosing evil.
.
- References:
- Prev by Date: Re: Get file version information in vb?
- Next by Date: Re: Get file version information in vb?
- Previous by thread: Re: XP problem with command line arguments with spaces
- Next by thread: Re: XP problem with command line arguments with spaces
- Index(es):
Relevant Pages
|