Re: Execute a batch file on remote host

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




Thank you Richard. Your script looks really nice but I have a problem
with it. I'm not working on a domain. I'm trying to incorporate code
to do this in a VB program I'm writing. I have the process of ending
tasks down but I'm trying to incorporate batch files to shut down and
restart Cold Fusion and IIS. We have batch files to do this but not all
the servers have them.

I'm doing this in my spare time to try and help our NOC guys with their
job. Also I'm getting let go at the end of July. I wanted to do
something to help before I leave. It will also help me with getting
back into programming. I'm going to see if the company that bought us
will give me a good recommendation for my next job. My wife wants to go
back to Europe. She's a member of the EU but I'm not.

Any help will be greatly appreciated.

Thank you.

'Richard Mueller [MVP Wrote:
;3272402']Dennis wrote:

Running Windows 2003 R2 I need to execute a batch on remote Windows
2003 R2 machine.

I have tried a number of things including rexec, etc.

The goal would not to deploy any additional code to the remote host.

Is there a way to this via Cscript?do I need to write a vbs script?

A VBScript program can use WMI to connect to the remote computer, copy
the
executable (a batch file in this case), run it, wait for execution to
complete, then delete the file. I have an example VBScript program that
does
this for all computers in a domain group. You can either modify this
for one
computer, or place the computer object in a group by itself. The
program
deploys only to computers in the group, so it does not hurt to have
user
objects in the group.

http://www.rlmueller.net/Deploy.htm

The program writes a log to document everything.

--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--


--
1RealTruth
------------------------------------------------------------------------
1RealTruth's Profile: http://forums.techarena.in/members/106922.htm
View this thread: http://forums.techarena.in/server-scripting/843476.htm

http://forums.techarena.in

.



Relevant Pages