Solved batch file disable ALL services

Hewlett-packard Hp pavilion dv9000 lapto...
June 10, 2012 at 12:07:29
Specs: XP Vista Win7, P4 3Ghz 3G ram
I have batch files and reg files that disable known service that are un-necessary, and thanks to razer I can STOP all services, but not disalbe all services. I have modified the service stopper to;
for /f "tokens=*" %%a in ('net start') do echo y|sc config "%%a" start= disabled

but the sc command needs the serve name and not the service title.

I am scrolling through all the services to disable them all then re-enabling desired services. This is the only method I can think of other than manually disabling the services.

The Computer Dr
Chris Robertson


See More: batch file disable ALL services

Report •


✔ Best Answer
June 12, 2012 at 04:45:31
My approach would be to use a list of known Services to remain enabled, coupled with the output from the command:
REG QUERY HKLM\SYSTEM\CurrentControlSet\Services /S

When your only tool is a hammer, every problem looks like a nail.



#1
June 10, 2012 at 19:45:24
You first have to get the ServiceKeyName by using the SC command.
E.g.:
sc GetKeyName "Windows Image Acquisition (WIA)"

will return stisvc


Report •

#2
June 11, 2012 at 17:56:42
I was able to get the list of title and list the names. That's about all I can figure out.
So there is no way to list of name and set disabled?
I want to disable all so I won't know the name of the faudlent services.

for /f "skip=1 tokens=*" %%a in ('net start') do echo |sc getkeyname "%%a"

The Computer Dr
Chris Robertson


Report •

#3
June 11, 2012 at 18:01:40
Killing all services is a bad idea because they can ignore the shutdown command, and you can't do much with the machine until you reboot.

Disabling all services is a bad idea because it can potentially leave the machine in an unbootable state.

How To Ask Questions The Smart Way


Report •

Related Solutions

#4
June 11, 2012 at 18:06:03
Try this and see, what output you get:
for /f "skip=1 tokens=*" %%a in ('net start') do sc getkeyname "%%a"

Report •

#5
June 11, 2012 at 18:13:31
I apologize, as originally stated, I want to set all services to disabled then run the reg file that sets the defaut services start type.

The Computer Dr
Chris Robertson


Report •

#6
June 11, 2012 at 18:34:33
Well, even if I told you how to do it, a malicious service could prevent any change in itself though the ACL governing its configuration. And it can monitor changes to its registry keys, and prevent any modification to them.

You cannot fight a virus while it's running. The only sane options are to restore to a known good state, or clean the known infected drive in a known good environment. Where the virus can't fight you.

How To Ask Questions The Smart Way


Report •

#7
June 11, 2012 at 19:15:50
Yes, they work like Symantec services and restart themselves. I repair about 12 computers a day at our facility and I disable everything manually. Those that restart themselves are a great giveway. I have a utility that repalces the infected service. Currently the other script that stops ALL services then starts minimum amounts of services. It works great! I can install all my tools. I just would like to disable all the services and sets them to defaults keeps rouge/infected services from restarting. I do this manually too. It works and works well.

The Computer Dr
Chris Robertson


Report •

#8
June 12, 2012 at 04:45:31
✔ Best Answer
My approach would be to use a list of known Services to remain enabled, coupled with the output from the command:
REG QUERY HKLM\SYSTEM\CurrentControlSet\Services /S

When your only tool is a hammer, every problem looks like a nail.


Report •

#9
July 4, 2012 at 13:03:40
Hi I just stumbled across this post while looking for a similar batch file, my friend lives in Canada I am in the UK giving her remote desktop support the computer had over 500 infections of various categories from low to high threat. Because the computer is very slow to work on due to infections and because I seem to spend all my time fixing computers these days I was hoping someone can give me some code for my batch file to disable ALL none essential services so that I may be able to get more done faster.

Currently using Malware-Bytes and Emsisoft Anti-malware to clean the computer, I had one hell of a time trying to Install Zone Alarm firewall and Anti virus some infection on the machine keeps deleting the downloaded Virus Definition file it tried 3 times and it was hideously slow about 1% each 30 seconds we eventually got it to install but so far I have spent 34 hours none stop on this cleaning over TEAMVIEWER she can't find her Windows XP CD so we are really struggling any help much appreciated.

Michelle


Report •

#10
July 4, 2012 at 13:47:32
You can't win remotely against 500 active infections, nor can you win against the hundred or so active infections you didn't catch. The best you could possibly do is give her false confidence, and that's worse than no confidence. If she's not paying you for your services, tell her to take it to a local IT guy she knows. If she is paying for your services, tell her to take it to a local IT shop.

How To Ask Questions The Smart Way


Report •


Ask Question