Re: win32 process



if i use psexec, how can my vb.net code know that it has finished executing
so that i can move on to do the next stuff?

"Gerry Hickman" <gerry666uk@xxxxxxxxxxx> wrote in message
news:uf24PiWQGHA.5092@xxxxxxxxxxxxxxxxxxxxxxx
Hi Lynn,

hi,
I am using Win32_Process to launch a batch file on a remote computer.
How
can I know that the batch file has finished executing?
thanks

It's not as simple as it should be. One way is to use a loop which
checks for the existence of the Process ID in the Win32_Process list and
sleeps between checks. Once the Process ID is gone, you know it's
finished.

There's a free tool from SysInternals called PsExec though, which can be
much more powerful - it can actually communicate StdIn and StdOut with
the client - in other words you can actually see the output from the
batch file either on screen in real-time or sent to a log file for the
morning.

Another option is using WshRemote, but that's another story...

--
Gerry Hickman (London UK)


.



Relevant Pages

  • Re: Renaming computers using Logon scripts from GPO
    ... I already used psexec for many different things, but never to rename computers, sometimes things can get a little bit complicated, but other times they're very sinple and in most times running psexec against large number of machines can save you a lot of work, at least to me:). ... Inside that batch file insert the following code "cmd", save the file and close it. ... As I told you from the beginning I never used this tool to rename computers, or perhaps you may find other tools that do the same thing with less work, but since you can use this tool to open, or copy your own scripts and then run them from remote location, does not sound impossible to automate this job. ...
    (microsoft.public.windows.server.active_directory)
  • Re: What permissions do I need to use admin$ ?
    ... Maury Markowitz wrote: ... > All I need to do is run a batch file. ... > rcmd fails because on this machine any attempt to run with "allow ... I have made progress with psexec. ...
    (microsoft.public.windowsxp.security_admin)
  • Re: remotely invoke .bat file to run on target machine
    ... I'm writing a batch file that uses PsExec many times to perform many ... The internal commands of CMD.EXE are run the same way you would run them ... >> To use PsExec I use a wrapper batch file to copy the utility and the batch ...
    (microsoft.public.windows.server.scripting)
  • Re: remotely invoke .bat file to run on target machine
    ... I'm writing a batch file that uses PsExec many times to perform many ... > To use PsExec I use a wrapper batch file to copy the utility and the batch ...
    (microsoft.public.windows.server.scripting)
  • Re: win32 process
    ... I am using Win32_Process to launch a batch file on a remote computer. ... can I know that the batch file has finished executing? ...
    (microsoft.public.win32.programmer.wmi)