a .bat file to execute something into a different server

H

HuanManwe

Hello,

what I want to do is:

1.- Use a .bat file to get into a Win2003 Server (already done)

2.- Execute there "start services.msc" (I can only make it work
locally)

The idea was to see if certain services were started or not. For
example the IIS Server. But at least I needed to execute something
there.

This is what I've done until now.:

Code:
--------------------
@echo off

net use Q: \\servername domainname /user:serverIP\adminname password /PERSISTENT:NO

pause

echo We're in but now I try and execute services.msc:

START C:\WINDOWS\system32\services.msc

goto end

:end
echo End of process
--------------------


Can you help me?

Thank you all in advance.
 
A

Anteaus

net start >running.txt

if executed on the server, will create a file listing the running services.
You could schedule this to run at suitable intervals, and deposit its output
into a visible share, such as Q:

A slightly more sohisticated method would be to use AutoIt's ProcessExists()
fucntiion to poll the required services and produce a report.

It is in fact possible to launch a process on a remote computer, see
http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx
but this requires Domain Admin or server local-admin credentials to be
stored on the local computer, and thus exposes the server to all sorts of
security issues. In principle I don't recommend doing this kind of thing.
 
H

HuanManwe

Thank you very much. I'll give it a try at work and tomorrow I'll tell
you the results.

Best regards.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top