
Wscript.shell Run doesn't work
WScript 5.6 beta 1 has a new WshShell.CurrentDirectory property to do exactly that...
--
Michael Harris
Microsoft.MVP.Scripting
--
Please do not email questions - post them to the newsgroup instead.
--
Quote:
> It still doesn't work - but just for the fun of it, tried to write a bat
> file going (from root):
> cd somedir
> cd someotherdir
> FileIWantToRun.exe
> and that worked out ?? So it seems like I need to change the current path
> somehow (which isn't done by using
> WshShell.Run("c:\somedir\SomeOtherDir\FileRun.exe")
> but how do I do this ?? Tried the ChDir from VB but it doesn't work
> Toke
> > I have ran into the same problem in the past while running a {*filter*}
> server.
> > How I got around it was to create a batch file with the execute commands
> for
> > the dos file in there. This solved the problem and allowed me to run it
> as
> > a service :)
> > Later
> > Bryan Martin
> > > I'm trying to run an exe from a Vbscript the following way:
> > > dim Wshshell
> > > set WshShell = CreateObject("WScript.Shell")
> > > WshShell.Run ("c:\somedir\someprogram.exe")
> > > but nomatter what I do it doesn't work. Have tried the "cmd.exe
> > > c:\somedir\someprogram.exe" but that doesn't work either. It doesn't
> make
> > > any difference wheter I run the shell with or without a return value.
> > > If I go to the dir using the DOS prompt, and run the program manually,
> it
> > > works fine, and same thing happens if I use explorer to open up the dir
> > and
> > > run the file. If I place another exe in the same dir (label.exe) it runs
> > > fine. I use NT 4.0. The funny thing is, that if I keep the task
> manager
> > > open while running the script, I can see the program come up correctly
> in
> > > the lineup of tasks, but it still doesn't work. It's supposed to use one
> > on
> > > input file and make 3 small output files - has this got anything to do
> > with
> > > the problem ??
> > > Thanks in advance
> > > Toke