Re: remotely invoke .bat file to run on target machine



On Thu, 9 Jun 2005 18:53:34 -0700, "John Grandy"
<johnagrandy-at-yahoo-dot-com> wrote in
microsoft.public.windows.server.scripting:

>Hi Chris, and thanks for the response.
>
>PsExec is great !
>
>Ok, I'm writing a batch file that uses PsExec many times to perform many
>different actions ... most of them work, but ....
>
>I can't figure out how to get PsExec to run on another machine a command
>that is meant to be run from within cmd.exe ? For example "del" or "copy"
>or "net start" ?

The internal commands of CMD.EXE are run the same way you would run them
from a VB script: "CMD /c dir". However, "NET START" has nothing to do
with CMD.EXE and can be run without invoking CMD.

>"Chris Dugan" <chrisdotdugan@xxxxxxxxxxxxxxxxxxx> wrote in message
>news:j_1qe.12603$cN2.6255@xxxxxxxxxxxxxxxxxxxxxxx
>> Yep, you can use PsExec from www.sysinternals.com
>>
>> It is part of their PsTools suite (free!) that are a nice collection of
>> little tools and utilities for doing admin and configwork on networks.
>>
>> To use PsExec I use a wrapper batch file to copy the utility and the batch
>> file to the target pc then run it and then clean up.

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"
.



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: win32 process
    ... how can my vb.net code know that it has finished executing ... I am using Win32_Process to launch a batch file on a remote computer. ... There's a free tool from SysInternals called PsExec though, ... much more powerful - it can actually communicate StdIn and StdOut with ...
    (microsoft.public.win32.programmer.wmi)
  • 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 ... > To use PsExec I use a wrapper batch file to copy the utility and the batch ...
    (microsoft.public.windows.server.scripting)