Re: XP SP2 command line trouble - update
- From: "Randy Birch" <rgb_removethis@xxxxxxxx>
- Date: Tue, 18 Sep 2007 22:33:26 -0400
I guess I don't see the problem. If the OS is wrapping the path in quotes
for you automatically somewhere along the way, rejoice knowing you've gotten
the entire path. If parsing the path out your code would just have to
de-quote the strings, which would just need a function you pass any string
to - quoted or unquoted, you don't care - and have it return the unquoted
version. This would be simple enough ...
private function unquote(spath as string) as string
unquote = replace$(spath, chr$(34), "")
end function
You can do it with the API if you prefer - see
http://vbnet.mvps.org/code/fileapi/pathunquotespaces.htm.
--
Randy Birch
MS MVP, Visual Basic
http://vbnet.mvps.org/
Please respond to the newsgroups so all can benefit.
"mayayana" <mayaXXyana1a@xxxxxxxxxxxxxxxx> wrote in message
news:epXuVEm%23HHA.2004@xxxxxxxxxxxxxxxxxxxxxxx
if pathtoexe has spaces, then it should be quoted when adding to the
registry. Similarly, the %1 should be quoted ("%1") in case paths or
filenames containing spaces are passed.
That's good to know. I've seen the %1 both ways and
wondered how that affected things.
But that wouldn't be connected with the problem that's
showing up, would it? Explorer is sending the command line
fine, which implies that the Registry settings are OK, but the
command line itself, on at least this particular XP SP2
machine, includes quotes. I had the utility write the
command line it received to disk, and also wrote it as
a string of ascii numbers. On WinXP SP2 - where the
utility fails to find the file pointed to in the command line -
my log file shows a string like "C:\file.pdf"
The ascii string reads like: 34-67-58 ...etc. There
are actually quotes in the command string itself.
On Win98 the quotes are not there. I haven't tested
the logging on XP SP1, but I have tested the utility
itself with no problems.
.
- Follow-Ups:
- Re: XP SP2 command line trouble - update
- From: mayayana
- Re: XP SP2 command line trouble - update
- References:
- XP SP2 command line trouble - update
- From: mayayana
- Re: XP SP2 command line trouble - update
- From: Randy Birch
- Re: XP SP2 command line trouble - update
- From: mayayana
- XP SP2 command line trouble - update
- Prev by Date: Re: XP SP2 command line trouble - update
- Next by Date: Re: XP SP2 command line trouble - update
- Previous by thread: Re: XP SP2 command line trouble - update
- Next by thread: Re: XP SP2 command line trouble - update
- Index(es):
Relevant Pages
|