Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run Location 2

Status
Not open for further replies.

SQLScholar

Programmer
Aug 21, 2002
2,127
GB
Hey all,

I have a script - which part of it runs an EXE.

Now the EXE is on a local drive. When its run locally by double clicking, two files are created locally.

However when its run by VBS from the server (VBS on the server, EXE`s still on the C:\) the files end up on the server. I cant work this out as the exes being run are on the C:/

The EXE`s are not mine and i have no way to change them. So..... any ideas? A copy wouldnt work as there might be multiple people running this at the same time.

Dan

----------------------------------------
Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind - Dr. Seuss

Computer Science is no more about computers than astronomy is about telescopes - EW Dijkstra
----------------------------------------
 
it is probably due to the current working directory. when you launch your script from a windows explorer sessions the current working directory will be set to the server path.

try running your script from a cmd.exe windows from somewhere like c:\temp>....the files may end up there.

you can set the current working directory in your vbscript from FileSystemObject (, or is it WshShell i can never remember)
 
A script will run on the machine it was launched from. Consider using SystemInternals PSexec.exe to remotely start an program/script instance on a remote computer. However, the instance will run under the initiators namespace (profile) - most likely you. For instance, if you have a script that remotely installs printers and you want to remotely run it on Alice's computer, the printer's will be installed under YOUR namespace; Alice will not see them in her printers list.

-Geates
 
System Internals available from Microsoft.

- Geates
 
Set the WshShell.CurrentDirectory property before launching your EXE

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Sorry for not responding - i have been in lots of meetings.

Sorry to not spec. I was using Psexec.

The current director solved the issue. Many thanks

Dan

----------------------------------------
Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind - Dr. Seuss

Computer Science is no more about computers than astronomy is about telescopes - EW Dijkstra
----------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top