Re: writing a .bat file helppppp! ~urgent~



Yes. In this case you would use:

net stop "Server"
net start "Server"

I hope this helps,

--
Mike
Microsoft MVP - Windows Security

"maitakeboy" <maitakeboy@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B70DFB46-031F-4DB6-98B8-F15A7F385382@xxxxxxxxxxxxxxxx
>I have a similar issue. Am I understanding you correctly that you would use
> the Net Stop and Net Start commands even if you are running the batch file
> on
> the server where the service is running? I need to stop and start the
> Server
> service so I can close all open sessions for a utility to run. So would
> Net
> Stop Server do the trick?
>
> "Miha Pihler [MVP]" wrote:
>
>> Hi,
>>
>> I can't give you specific batch file since you didn't which services you
>> need to stop. Still the first batch file would be something like this.
>>
>> net stop "IMAPI CD-Burning COM Service"
>> net stop "Simple Mail Transfer Protocol (SMTP)"
>>
>> if "IMAPI CD-Burning COM Service" and "Simple Mail Transfer Protocol
>> (SMTP)"
>> are the services that you would like to stop.
>>
>> In second batch file you would have:
>>
>> net start "IMAPI CD-Burning COM Service"
>> net start "Simple Mail Transfer Protocol (SMTP)"
>>
>> Create two batch jobs - one for each of the batch files that will run at
>> desired times with appropriate permissions.
>>
>> I hope this helps.
>>
>> --
>> Mike
>> Microsoft MVP - Windows Security
>>
>> "noobtech" <noobtech@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:9C9CD611-6417-4607-BC21-3F577AF84CA0@xxxxxxxxxxxxxxxx
>> >I have wrote simple batch files before but now i'm stuck and need some
>> >help.
>> > We have 5 services that needs to be shutdown at 2 am in the morning.
>> > There
>> > is
>> > no way around it.
>> >
>> > I need to write a batch file that, without user intervention (batch
>> > file
>> > has
>> > to run on it's own)
>> >
>> > 1.) proceeds to shut down 5 specific services on the server at a
>> > designated
>> > time.
>> > 2.) then after 30 mins proceeds to restart all 5 services (again
>> > without
>> > user intervention)
>> >
>> > How do i do this?
>>
>>
>>


.



Relevant Pages

  • Re: SPBackup utility failing
    ... generates a batch file that, when run on a server running Windows SharePoint ... backs up changed site collections using the Stsadm.exe tool. ... >> Mike Walsh, Helsinki, Finland ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: Access Denied Error -- Reading Text File in .BAT program
    ... without seeing the whole batch file I am unable to offer any further ... echo Start %date% %TimeMarker%>> c:\test.txt ... on the server console. ... It is strange the file disappears completely after using the NET FILE ...
    (microsoft.public.scripting.wsh)
  • Re: back not backing up
    ... and buy the best backup server software i can buy. ... run the batch file via the Task Scheduler. ... > lie in areas other than server management. ...
    (microsoft.public.windows.server.general)
  • RE: Windows 2003 Server Terminal Services
    ... I tried the first .bat idea, and though it worked, it left the batch file ... accessing applications which they should run. ... MCSE, CCEA, Microsoft MVP - Terminal Server ... Terminal Server role and the Terminal Services Licensing ...
    (microsoft.public.windows.terminal_services)
  • Re: Access Denied Error -- Reading Text File in .BAT program
    ... Since you can't post the whole batch file, I can only offer some hints: ... echo Start %date% %TimeMarker%>> c:\test.txt ... on the server console. ... It is strange the file disappears completely after using the NET FILE ...
    (microsoft.public.scripting.wsh)