Re: Paths including spaces



BTW, what's wrong with my original suggestion to enclose the path in quotes?

--
Björn Holmgren


"Björn Holmgren" <bjohol@xxxxxxxxxxx> wrote in message
news:ydr5e.42488$Of5.28235@xxxxxxxxxxxxxxxxxxxxxx
> And how is the script supposed to figure out that sequence number?
>
> If you're going for the "short path" solution, then at least use the
> FSO ShortPath property. It's the only way to know for sure.
>
> Set objShell = CreateObject("WScript.Shell")
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> Set objFile = objFSO.GetFile(objShell.ExpandEnvironmentStrings( _
> "%ProgramFiles%\TestApp\RunMe.exe"))
> sEXEFullPath = objFile.ShortPath & " /silent"
>
> --
> Björn Holmgren
>
>
> "Rafael T" <okinawapro@xxxxxxxxxxx> wrote in message
> news:#t3YkEBPFHA.3000@xxxxxxxxxxxxxxxxxxxxxxx
> > I usually use the old trick for long file names, 8 characters. The first
6
> > are from the real name and then follow by a ~ and at last the number 1
if
> it
> > is the first or only file/folder with those first 6 letters.
> >
> > in your case
> > progra~1/TestApp\runme.exe
> >
> > try it and see if it works
> > RT
> >
> > "Wayne Gore" <WayneGore@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> > news:9F5C05B5-DDF2-4D9A-A090-A6FF4D5D65E2@xxxxxxxxxxxxxxxx
> > > Hi
> > >
> > > I'm trying to put together a script which expands %ProgramFiles% and
> then
> > > run an executable called "RunMe.exe" from a folder called "TestApp".
> > >
> > > Here's what I've done:
> > >
> > > Set oWshShell = CreateObject("WScript.Shell")
> > > sEXEFullPath = oWshShell.ExpandEnvironmentStrings("%ProgramFiles%" &
> > > "\TestApp\RunMe.exe /silent")
> > > Return = oWshShell.Run(sEXEFullPath,,true)
> > >
> > > The error message states that "The system cannot find the file
> > > specified.".
> > > I know that the file is there and just to check I added the row
> > > "WScript.Echo sEXEFullPath" to check that the path is correct. Every
> thing
> > > is
> > > ok.
> > >
> > > As far as I can tell, the reason for the failure of the run command is
> the
> > > space between "Program" and "Files" in the expanded path. It seems as
if
> > > the
> > > engine only sees "C:\Program" and not "C:\Program
> Files\TestApp\RunMe.exe
> > > /silent".
> > >
> > > How can I fix this?
> > >
> > > Regards
> > > Wayne
> > >
> >
> >
>
>


.



Relevant Pages

  • Re: HANDY FARM DEVICES
    ... >>That's because you didn't enclose the string in quotes. ... >>Try the same phrase in quotes and you'll find it returns 4 (Yes, ...
    (rec.woodworking)
  • Re: Type mismatch in ADO Recordset Open
    ... Enclosing the variable in quotes as I suggest won't sorce Access to search ... Dim strISBN As String ... Why would I enclose it in quotes? ...
    (microsoft.public.access.formscoding)
  • Re: Agent 3.0 Woof
    ... >> Sipowitz001@xxxxxxxxx appears to have caused the following letters to ... >>> If you enclose in quotes then at least do so with some accuracy. ... > Why should I, as a consumer, care about that? ...
    (rec.music.classical.recordings)
  • Re: Double Spaces in Group Name prevents export!!
    ... The filter clause should be enclosed in parenthesis, not quotes. ... should enclose the distinguished name of the group. ... Microsoft MVP Scripting and ADSI ...
    (microsoft.public.windows.server.active_directory)
  • Re: Type mismatch in ADO Recordset Open
    ... Why would I enclose it in quotes? ... just appending the variable to the explicit string. ... field of the Book Information table for the literal value "strISBN"? ...
    (microsoft.public.access.formscoding)