How to Start any Windows Service Through Macro Scheduler

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

How to Start any Windows Service Through Macro Scheduler

Post by armsys » Sat Jan 03, 2009 6:45 am

When the Startup Type of some Windows Services are set to be Manual, how to start/stop these services such as Diskeeper from a MS Script?

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Sat Jan 03, 2009 4:49 pm

You can use NET START / STOP from the command line so I imagine it can be used in Macro Scheduler too (but I haven't tried it). Lots of info on the 'net such as this and this.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sat Jan 03, 2009 5:29 pm

Yup:

Let>RP_WAIT=1
Run>NET STOP ServiceName

Let>RP_WAIT=1
Run>NET START ServiceName

Or via VBScript:
http://www.mjtnet.com/forum/viewtopic.php?t=1779
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Sun Jan 04, 2009 1:28 am

Hi Marcus & Me_again,
Thanks for your fast help. Your solutions work brilliantly.
If the precise ServiceName/spelling isn't known, type Net Stop or Net Start in Cmd window to find out.
Thank you.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts