Re: XP SP2 command line trouble - update

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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.


.



Relevant Pages

  • Re: Get Selected Path From Explorer
    ... Getting a file string from Explorer from VB using the Command line ... In this instance stripping the quotes from the beginning and end of the ... strExplorerPath = Left$- 1) ...
    (microsoft.public.vb.general.discussion)
  • Re: runas: need help with those quotes
    ... matters, both paths have spaces, so they are enclosed in quotes. ... 'This command echos the the strCmd to the screen. ... Quotes embedded in a quoted string should be doubled. ...
    (microsoft.public.scripting.vbscript)
  • Re: runas: need help with those quotes
    ... matters, both paths have spaces, so they are enclosed in quotes. ... 'This command echos the the strCmd to the screen. ... Quotes embedded in a quoted string should be doubled. ...
    (microsoft.public.scripting.vbscript)
  • Re: Update existing values incrementally w/UPDATE SQL
    ... I think it would be safe to say, use the Dim statement any time you are ... Dim basically tells vba that you want to initiate a new variable. ... As far as quotes go, this was one of the trickiest ... Consider vba's interpretation of a string: ...
    (microsoft.public.access.modulesdaovba)
  • Parsing a bash string?
    ... For my application, which is a wrapper over bash, ... I have to be able to parse a command line typed by the user. ... I.e., I need a function that, when given a typical bash command string like ... I have to remove the quotes (notice the last ...
    (comp.unix.shell)