How to write a batch file (Full Version)

All Forums >> [Web Development] >> Server Issues



Message


JemperLynn -> How to write a batch file (12/2/2002 16:14:11)

Okay, I know this may not be the best place to ask this question but I thought I would try....

I need to write a batch file that would stop and start a service on my server. Could someone show me how to do this or give me a website that will explain batch files to me.

Don' t tell me to ask my server administrator... I have to figure this out myself. The service is for a program my site connects to.

Help me PLEASE!!!!!!!!!




Gil -> RE: How to write a batch file (12/2/2002 16:43:14)

If you just need to start and stop a service you could probably use a cron job - assuming a Unix server (beats me using a Windoze server). If you are on Unix see: http://www.unixgeeks.org/security/newbie/unix/cron-1.html




caywind -> RE: How to write a batch file (12/2/2002 22:15:45)

windoze uses the AT command.

here' s some examples:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q313289&sd=tech

you can type: at /? for help




Doug G -> RE: How to write a batch file (12/3/2002 0:07:12)

net start service

or

net stop service

in a .bat file. You can use the AT scheduler if you wish.

You can find all the batch file commands in windows help on the server. search for batch or command to find the list of available batch file commands.

If your server is W2K or if you have Windows Scripting Host installed you can use scripting to perform complicated batch operations.




Doug G -> RE: How to write a batch file (12/3/2002 0:09:01)

And regardless of other posts here, the name of the Microsoft operating system is " Windows" :)





JemperLynn -> RE: How to write a batch file (12/3/2002 10:38:12)

Would these commands do what I need to do?

net svc " complete name of service" \\xxx /stop
net svc " complete name of service" \\xxx /start

where xxx is the name of the machine the service is located on in the network

thanks guys
Jemper




Doug G -> RE: How to write a batch file (12/3/2002 16:34:43)

I haven' t controlled services on different machines on the network, but I believe you' re on the right track. I know there are some 3rd party applications to make this job easier. Sorry I don' t have any specifics for you though :)




JemperLynn -> RE: How to write a batch file (12/4/2002 10:58:28)

Thanks for your reply guys! I tried out the lines in my last post and they worked. I found out that you can only use the net start commeand if you are starting a service on that machine otherwise you have to tell the computer the where to find the service first, then tell it what to do.

Jemper




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
4.699707E-02