Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Bat file to stop and change services


  • Please log in to reply
11 replies to this topic

#1 surge1223

surge1223

  • Members
  • 22 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:05:27 AM

Posted 21 June 2013 - 10:53 PM

I want to create a .bat file that runs these commands with these "name of service" replaced by all of the services i have listed below the commands, anyone know how to do this? Any help would be appreciated

 

 

sc stop "Name of Service"
sc config "Name of Service" start= disabled

SharedAccess
IKEEXT
iphlpsvc
KtmRm
lltdsvc
wlidsvc
MSiSCSI
Netlogon
napagent
CscService
PNRPsvc
p2psvc
p2pimsvc
PNRPAutoReg
WPDBusEnum
PrintNotify
SessionEnv
TermService
UmRdpService
RpcLocator
RemoteRegistry
RemoteAccess
seclogon
wscsvc
SensrSvc
SCardSvr
SCPolicySvc
SNMPTRAP
SSDPSRV
StorSvc
SystemEventsBroker
lmhosts
TapiSrv
TimeBroker
WbioSrvc
wcncsvc
StiSvc
WMPNetworkSvc
WSearch
W32Time


Edited by surge1223, 21 June 2013 - 10:54 PM.


BC AdBot (Login to Remove)

 


#2 Zestypanda

Zestypanda

  • Members
  • 603 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Sunny San Diego, California.
  • Local time:05:27 AM

Posted 21 June 2013 - 11:44 PM

If I hear you correctly, you want to disable all those services listed above?

Have a question, or just wanna chat? Send me a message. Or add me as a friend.

 


#3 surge1223

surge1223
  • Topic Starter

  • Members
  • 22 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:05:27 AM

Posted 22 June 2013 - 01:44 AM

Yes. But I want the bat file to rename "Name of Service" with a variable and set the the variable to the services I listed above

 

 



#4 Zestypanda

Zestypanda

  • Members
  • 603 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Sunny San Diego, California.
  • Local time:05:27 AM

Posted 22 June 2013 - 01:50 AM

Like
Disable services
Select a service to disable
1.) blah
2.) blagh
3.)bloop
Like that?

Have a question, or just wanna chat? Send me a message. Or add me as a friend.

 


#5 surge1223

surge1223
  • Topic Starter

  • Members
  • 22 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:05:27 AM

Posted 22 June 2013 - 04:02 AM

Well yeah kinda but i want to use the sc commands and first stop and then disable the services.  Kinda like the following example, but with using sc instead of net stop and if there was an easier way to auto fill the "Name of Service" field with the names of the services i listed at the end of the first post.  Thanks

 

@echo off
echo Stop the following Services?
echo off
echo WebClient
echo Windows Image Acquisition (WIA)
echo Windows Management Instrumentation
echo Workstation
echo off
pause
net stop "WebClient"
net stop "Windows Image Acquisition (WIA)"
net stop "Windows Management Instrumentation"
net stop "Workstation"
pause
 


Edited by surge1223, 22 June 2013 - 04:03 AM.


#6 Zestypanda

Zestypanda

  • Members
  • 603 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Sunny San Diego, California.
  • Local time:05:27 AM

Posted 22 June 2013 - 12:33 PM

Ok, I'm in the process of making a batch file for this, please be patient.

Have a question, or just wanna chat? Send me a message. Or add me as a friend.

 


#7 surge1223

surge1223
  • Topic Starter

  • Members
  • 22 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:05:27 AM

Posted 22 June 2013 - 05:21 PM

Well I got it to work, its not the prettiest thing, but hey. But if you see any thing here i should note, let me know. Thanks
 
echo OFF
echo Stop and disable all dumb Windows 7/8 services bro?
echo off
pause
sc stop CscService
sc stop IKEEXT
sc stop iphlpsvc
sc stop KtmRm
sc stop lltdsvc
sc stop lmhosts
sc stop MSiSCSI
sc stop napagent
sc stop Netlogon
sc stop p2pimsvc
sc stop p2psvc
sc stop PNRPAutoReg
sc stop PNRPsvc
sc stop RemoteAccessd
sc stop sCardSvr
sc stop sCPolicySvc
sc stop sensrSvc
sc stop sessionEnv
sc stop sNMPTRAP
sc stop sSDPSRV
sc stop stisvc
sc stop systemEventsBroker
sc stop TapiSrv
sc stop TermService
sc stop TimeBroker
sc stop UmRdpService
sc stop W32Time
sc stop WbioSrvc
sc stop wcncsvc
sc stop wlidsvc
sc stop WMPNetworkSvc
sc stop WPDBusEnum
sc stop SharedAccess
sc stop PrintNotify
sc stop seclogon
sc stop Storsvc
sc stop Wsearch
pause
sc config "CscService" start= disabled
sc config "IKEEXT" start= disabled
sc config "iphlpsvc" start= disabled
sc config "KtmRm" start= disabled
sc config "lltdsvc" start= disabled
sc config "lmhosts" start= disabled
sc config "MSiSCSI" start= disabled
sc config "napagent" start= disabled
sc config "Netlogon" start= disabled
sc config "p2pimsvc" start= disabled
sc config "p2psvc" start= disabled
sc config "PNRPAutoReg" start= disabled
sc config "PNRPsvc" start= disabled
sc config "RemoteAccess" start= disabledd
sc config "sCardSvr" start= disabled
sc config "sCPolicySvc" start= disabled
sc config "sensrSvc" start= disabled
sc config "sessionEnv" start= disabled
sc config "sNMPTRAP" start= disabled
sc config "sSDPSRV" start= disabled
sc config "stisvc" start= disabled
sc config "systemEventsBroker" start= disabled
sc config "TapiSrv" start= disabled
sc config "TermService" start= disabled
sc config "TimeBroker" start= disabled
sc config "UmRdpService" start= disabled
sc config "W32Time" start= disabled
sc config "WbioSrvc" start= disabled
sc config "wcncsvc" start= disabled
sc config "wlidsvc" start= disabled
sc config "WMPNetworkSvc" start= disabled
sc config "WPDBusEnum" start= disabled
sc config "SharedAccess" start= disabled
sc config "PrintNotify" start= disabled
sc config "seclogon" start= disabled
sc config "Storsvc" start= disabled
sc config "Wsearch" start= disabled
pause
 

 

 


Edited by surge1223, 22 June 2013 - 07:00 PM.


#8 Zestypanda

Zestypanda

  • Members
  • 603 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Sunny San Diego, California.
  • Local time:05:27 AM

Posted 22 June 2013 - 07:45 PM

Ok, I'm pressed for time ATM but I will give it a look over later. ~Zestypanda.

Have a question, or just wanna chat? Send me a message. Or add me as a friend.

 


#9 Broni

Broni

    The Coolest BC Computer


  • BC Advisor
  • 42,656 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Daly City, CA
  • Local time:03:27 AM

Posted 22 June 2013 - 08:50 PM

I'm just curious...

Are you trying to make some computer unbootable?


My Website

p4433470.gif

My help doesn't cost a penny, but if you'd like to consider a donation, click p22001735.gif


 


#10 Zestypanda

Zestypanda

  • Members
  • 603 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Sunny San Diego, California.
  • Local time:05:27 AM

Posted 22 June 2013 - 09:13 PM

I wasn't going to judge or jump to conclusions, but some of those services are sorta vital to a working PC

Have a question, or just wanna chat? Send me a message. Or add me as a friend.

 


#11 surge1223

surge1223
  • Topic Starter

  • Members
  • 22 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:05:27 AM

Posted 24 June 2013 - 07:31 AM

Haha, no I was checking admin privileges. Sorry maybe I should edit it so someone naive doesnt break their pc.

Edited by surge1223, 24 June 2013 - 07:31 AM.


#12 surge1223

surge1223
  • Topic Starter

  • Members
  • 22 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:05:27 AM

Posted 24 June 2013 - 01:04 PM

Here is Black Viper's "safe" list configuration for the services listed below, just incase anyone accidently ran that.  I removed the stop values and attached the "safe" start up types for Windows 8 Pro.

echo OFF
echo Stop and disable all dumb Windows 7/8 services bro?
echo off
pause
sc stop iphlpsvc
sc stop MSiSCSI
sc stop napagent
sc stop Netlogon
sc stop RemoteAccess
sc stop sCardSvr
sc stop sCPolicySvc
sc stop sensrSvc
sc stop sNMPTRAP
sc stop WbioSrvc
sc stop wcncsvc
sc stop WMPNetworkSvc
sc stop SharedAccess
sc stop Storsvc

pause
sc config "CscService" start= auto
sc config "IKEEXT" start= demand
sc config "iphlpsvc" start= disabled
sc config "KtmRm" start= demand
sc config "lltdsvc" start= demand
sc config "lmhosts" start= auto
sc config "MSiSCSI" start= disabled
sc config "napagent" start= disabled
sc config "Netlogon" start= disabled
sc config "p2pimsvc" start= demand
sc config "p2psvc" start= demand
sc config "PNRPAutoReg" start= demand
sc config "PNRPsvc" start= demand
sc config "RemoteAccess" start= disabled
sc config "sCardSvr" start= disabled
sc config "sCPolicySvc" start= disabled
sc config "sensrSvc" start= disabled
sc config "sessionEnv" start= demand
sc config "sNMPTRAP" start= disabled
sc config "sSDPSRV" start= demand
sc config "stisvc" start= demand
sc config "systemEventsBroker" start= demand
sc config "TapiSrv" start= demand
sc config "TermService" start= demand
sc config "TimeBroker" start= demand
sc config "UmRdpService" start= demand
sc config "W32Time" start= demand
sc config "WbioSrvc" start= disabled
sc config "wcncsvc" start= disabled
sc config "wlidsvc" start= demand
sc config "WMPNetworkSvc" start= disabled
sc config "WPDBusEnum" start= demand
sc config "SharedAccess" start= disabled
sc config "PrintNotify" start= demand
sc config "seclogon" start= demand
sc config "Storsvc" start= disabled
sc config "Wsearch" start= delayed-auto
pause






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users