set objWMIService = GetObject("winmgmts://" & Computer)
set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run "C:\Program Files\Resource Kit\diskpart \s
listdisk.txt"
First off, I'm guessing that this tidbit of code will try
to run diskpart on the local machine. How can I bind
objShell to the remote machine (Computer)?
Thanks.
-Dave
You seem to be a bit mixed with windows scripting host and WMI. WSH 5.6 will
allow you to run script files on a remote machine but only script files
(wsf, vbs etc.). To run a program remotely you'd need to WMI. The following
few lines show how you can do this although I've found that detecting when
the remote process has completed is not always successful.
Set refWMI =
GetObject("Winmgmts:{impersonationLevel=impersonate}!\\SERVERNAME")
Set refProcess = refWMI.Get("Win32_Process")
refProcess.Create "c:\..\iexplore.exe", null, null, intHandle
The preceding code will create an instance of iexplore on the remote machine
which will be running in the security context of the person running the
script. The variable intHandle is passed the PID of the process (which can
be seen in Task Manager) so you can detect its completion or kill it. The
path to the executable has to be a full local path and generally, no-one
will be able to see the remote process running except through task maanger
(I found on Windows 2000 you could sometimes see the internet explorer
window).
Hope this helps and good Luck.
"Dave" <pow...@fastmail.fm> wrote in message
news:058701c34a6a$e6b2c450$a301...@phx.gbl...