+13 votes
1.7k views
in Programming by (370 points)
retagged by
I want to create a window service from CMD and also want to delete old service of my application.
closed

2 Answers

+1 vote
by Expert (5.9k points)
selected by
 
Best answer

its very simple For cretion of a service from cmd , write these command in CMD

sc create MySystemCmdBox binPath= "C:\windows\system32\cmd.exe /k cmd" type= own type= interact error= ignore start= demand

Here MySystemCmdBox  is service name 

C:\windows\system32\cmd.exe = path of executable 

For delete a service form CMD

sc delete MySystemCmdBox 

then execute.

NOTE : you should open cmd with run as Administrator

 

0
by (370 points)
Thanks himanshu!
+1 vote
by
edited by
Nice its working, I also used the same for deleting my windows apache services. Thanks man!

Not a Member yet?

Ask to Folks Login

My Account

Your feedback is highly appreciated