Create Service, Delete Service, Config Service in a script

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

Create Service, Delete Service, Config Service in a script

Post by gdyvig » Tue Apr 14, 2009 3:47 pm

You may have found many posts abd the blog explaining how to manually convert a compiled macro into a service using srvany.exe and more posts on how to stop and start that service within a script.

Here I found a post mentioning sc.exe by Lumumba which lets you add a service, delete a service , and configure a service within a script or bat file. For usage syntax, just start a cmd window end enter sc.exe. The purpose of my post is to make c:\windows\system32\sc.exe easier to discover using Search.

http://www.mjtnet.com/usergroup/viewtop ... 2a4898be5c

Here is an example of use in a bat file:

Code: Select all

sc.exe create MyProcess Type= own BinPath= "c:\program files\windows resource kits\tools\srvany.exe" Start= auto Obj= MyDomain\MyUser password= MyPassword DisplayName= MyProcess

Hope someone finds this useful,

Gale
[/quote]

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