Win7 optimized batch processing (applicable to win8)

Source: Internet
Author: User
Tags echo display

@ Echo off
Cls
Color 17
: Main
Cls
Echo -------- Window7 optimized batch processing ----------
Echo.
Echo 1-one-click Optimization
Echo 2-optimization service
Echo 3-clear garbage
Echo 4-optimized Registry
Echo 5-Disable default sharing
Echo 6-disable ports 135,139,445,593,102, 137,138,201
Echo 0-exit
Echo by Fenglin volcano
Echo -----------------------------------
For echo, enter [Serial Number + press enter ]:
Set rmain = 1
Set/p input =
If % input % = 1 goto a else goto main
If % input % = 2 goto B else goto main
If % input % = 3 goto c else goto main
If % input % = 4 goto d else goto main
If % input % = 5 goto e else goto main
If % input % = 6 goto f else goto main
If % input % = 0 exit
Goto main
:
Set dd = B c d e f
Set rmain = 0
For % a in (% dd %) do (goto %)
Goto main
: B
Echo started to optimize win7 service items...
@ Echo on
SC config AxInstSV start = demand
SC config SensrSvc start = disabled
SC config AeLookupSvc start = disabled
SC config AppIDSvc start = demand
SC config Appinof start = demand
SC config ALG start = disabled
SC config AppMgmt start = disabled
SC config BITS start = demand
SC config BFE start = auto
SC config BDESVC start = disabled
SC config wbengine start = disabled
SC config bthserv start = disabled
SC config peerdistsvc start = disabled
SC config certpropsvc start = disabled
SC config keyiso start = demand
SC config eventsystem start = auto
SC config comsysapp start = demand
SC config browser start = demand
SC config vaultsvc start = dsiabled
SC config cryptsvc start = auto
SC config dcomlaunch start = auto
SC config uxsms start = auto
SC config dhcp start = auto
SC config dps start = disabled
SC config wdiservicehost start = disabled
SC config wdisystemhost start = disabled
SC config defragsvc start = demand
SC config trkwks start = disabled
SC config msdtc start = demand
SC config dnscashe start = auto
SC config efs start = disabled
SC config eaphost start = demand
SC config fax start = disabled
SC config fdphost start = disabled
SC config fdrespub start = disabled
SC config gpsvc start = auto
SC config hkmsvc start = disabled
SC config homegrouplistener start = disabled
SC config homegroupprovider start = disabled
SC config hidserv start = disabled
SC config ikeext start = demand
SC config ui0detect start = disabled
SC config sharedaccess start = disabled
SC config iphlpsvc start = disabled
SC config policyagent start = auto
SC config ktmrm start = demand
SC config lltdsvc start = disabled
SC config mcx2svc start = disabled
SC config clr_optimization_v2.0.50727_32 start = demand
SC config clr_optimization_v4.0.30319_32 start = auto
SC config swprv start = demand
SC config mmcss start = auto
SC config nettcpportsharing start = disabled
SC config netlogon start = disabled
SC config napagent start = disabled
SC config netman start = demand
SC config netprofm start = demand
SC config nlasvc start = auto
SC config nsi start = auto
SC config cscservice start = disabled
SC config wpcsvc start = disabled
SC config pnrpsvc start = disabled
SC config p2psvc start = disabled
SC config p2pimsvc start = disabled
SC config pla start = demand
SC config plugplay start = auto
SC config ipbusenum start = disabled
SC config pnrpautoreg start = disabled
SC config wpdbusenum start = disabled
SC config power start = auto
SC config spooler start = auto
SC config wercplsupport start = disabled
SC config pcasvc start = disabled
SC config protectedstorage start = demand
SC config qwave start = disabled
SC config rasauto start = demand
SC config rasman start = demand
SC config sessionenv start = disabled
SC config termservice start = disabled
SC config umrdpservice start = disabled
SC config rpcss start = disabled
SC config rpclocator start = disabled
SC config remoteregistry start = disabled
SC config remoteaccess start = disabled
SC config rpceptmapper start = auto
SC config seclogon start = demand
SC config sstpsvc start = demand
SC config samss start = auto
SC config wscsvc start = delayed-auto
SC config lanmanserver start = auto
SC config shellhwdetection start = auto
SC config scardsvr start = disabled
SC config scpolicysvc start = disabled
SC config snmptrap start = disabled
SC config sppsvc start = delayed-auto
SC config sppuinotify start = demand
SC config ssdpsrv start = demand
SC config storsvc start = demand
SC config sysmain start = auto
SC config sens start = auto
SC config tabletinputservice start = disabled
SC config schedule start = auto
SC config lmhosts start = auto
SC config tapisrv start = demand
SC config themes start = auto
SC config threadorder start = demand
SC config tbs start = demand
SC config upnphost start = demand
SC config profsvc start = auto
SC config vds start = demand
SC config vss start = demand
SC config webclient start = disabled
SC config audiosrv start = auto
SC config audioendpointbuilder start = auto
SC config sdrsvc start = demand
SC config wbiosrvc start = disabled
SC config idsvc start = disabled
SC config wcspluginservice start = disabled
SC config windefend start = disabled
SC config wudfsvc start = demand
SC config wersvc start = disabled
SC config wecsvc start = demand
SC config eventlog start = auto
SC config mpssvc start = auto
SC config fontcache start = demand
SC config stisvc start = demand
SC config msiserver start = demand
SC config winmgmt start = auto
SC config ehrecvr start = disabled
SC config ehsched start = disabled
SC config wmpnetworksvc start = disabled
SC config trustedinstaller start = demand
SC config fontcache3.0.0.0 start = demand
SC config winrm start = disabled
SC config wsearch start = disabled
SC config w32time start = demand
SC config wuauserv start = delayed-auto
SC config winhttpautoproxysvc start = disabled
SC config dot3svc start = demand
SC config wlansvc start = demand
SC config wmiapsrv start = demand
SC config lanmanworkstation start = auto
SC config wwansvc start = demand
Echo win7 service item optimized!
@ Echo off
If % rmain % = 1 goto main

: C
Echo is clearing the System junk file. Please wait ......
Del/f/s/q % systemdrive % \ *. tmp 2> nul
Del/f/s/q % systemdrive % \ *. _ mp 2> nul
Del/f/s/q % systemdrive % \ *. log 2> nul
Del/f/s/q % systemdrive % \ *. gid 2> nul
Del/f/s/q % systemdrive % \ *. chk 2> nul
Del/f/s/q % systemdrive % \ *. old 2> nul
Del/f/s/q % windir % \ *. bak 2> nul
Rd/s/q % windir % \ temp & md % windir % \ temp 2> nul
Cacls % windir % \ temp/t/g administrators: f system: f
Del/f/q % userprofile % \ cookies \ *. * 2> nul
Del/f/s/q % userprofile % \ recent \ *. * 2> nul
Del/f/s/q "% userprofile % \ Local Settings \ Temporary Internet Files \ *. *" 2> nul
Rd/s/q % userprofile % \ Local Settings \ Temp & md % userprofile % \ Local Settings \ Temp 2> nul
Cacls % userprofile % \ Local Settings \ Temp/t/g administrators: f system: f
Echo cleared system garbage!
Echo starts cleaning up the garbage from other disks...
Set str = d e f g h I j k l m n o p q r s t u v w x y z
For % a in (% str %) do (%:
Del/f/s/q *. log
Del/f/s/q *. tmp
Del/f/s/q thumbs. db)
Echo clears the garbage from other disks!
If % rmain % = 1 goto main

: D
Echo to optimize the registry...
Echo Disable Remote Assistance
Set pp = "HKLM \ SYSTEM \ CurrentControlSet \ Control \ Terminal Server"
Reg add % pp %/v fAllowToGetHelp/t REG_DWORD/d 0/f> nul
Reg add % pp %/v DeleteTempDirsOnExit/t REG_DWORD/d 1/f> nul
Echo disable System Restoration
Set pp = "HKLM \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \ SystemRestore"
Reg add % pp %/v DisableSR/t REG_DWORD/d 1/f> nul
Echo disable sleep
Set pp = "HKLM \ SYSTEM \ ControlSet001 \ Control \ Power"
Reg add % pp %/v HibernateEnable/t REG_DWORD/d 0/f> nul
Echo add notepad right-click menu option
Set pp = "HKCR \ * \ shell \ open with Notepad"
Reg add % pp %
Set pp = "HKCR \ * \ shell \ open \ command in Notepad"
Reg add % pp %
Reg add % pp %/v (default)/t REG_SZ/d "notepad % 1"/f> nul
Echo disables automatic operation of optical disks and USB flash drives
Set pp = "HKCU \ Software \ Microsoft \ Windows \ CurrentVersion \ Policies \ Explorer"
Reg add % pp %/v NoDriveTypeAutoRun/t REG_DWORD/d 255/f> nul
Set pp = "HKLM \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Policies \ Explorer"
Reg add % pp %/v NoDriveTypeAutoRun/t REG_DWORD/d 255/f> nul
Set pp = "HKLM \ SYSTEM \ ControlSet001 \ Services \ cdrom"
Reg add % pp %/v Autorun/t REG_DWORD/d 0/f> nul
Set pp = "HKLM \ SYSTEM \ CurrentControlSet \ Services \ cdrom"
Reg add % pp %/v Autorun/t REG_DWORD/d 0/f> nul
Echo add CMD right-click menu
Set pp = "HKLM \ SOFTWARE \ Classes \ Folder \ shell \ cmd"
Reg add % pp %
Set pp = "HKLM \ SOFTWARE \ Classes \ Folder \ shell \ cmd \ command"
Reg add % pp %
Reg add % pp %/v (default)/t REG_SZ/d "cmd.exe/k cd % 1"/f> nul
Echo enable TCP/IP half-open connection
Set pp = "HKLM \ CurrentControlSet \ Services \ Tcpip \ Parameters"
Reg add % pp %/v EnableConnectionRateLimiting/t REG_DWORD/d 0/f> nul
Echo display file extension
Set pp = "HKCU \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ Advanced"
Reg add % pp %/v HideFileExt/t REG_DWORD/d 0/f> nul
Echo optimized the registry!
If % rmain % = 1 goto main

: E
Echo starts to disable the default share...
Net share ipc $/del
For % a in (% str %) do (net share % a $/del)
Echo Disabled Default sharing successfully!
If % rmain % = 1 goto main

: F
Echo starts to close the port...
Netsh ipsec static add filteraction name = block action = block
Netsh ipsec static add policy name = default policy
Netsh ipsec static add filterlist name = default filter
Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 135 protocol = tcp mirrored = yes
Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 135 protocol = udp mirrored = yes
Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 139 protocol = tcp mirrored = yes
Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 139 protocol = udp mirrored = yes
Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 445 protocol = tcp mirrored = yes
Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 445 protocol = udp mirrored = yes
Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 593 protocol = tcp mirrored = yes
Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 593 protocol = udp mirrored = yes
Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 1025 protocol = tcp mirrored = yes

Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 1025 protocol = udp mirrored = yes

Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 3389 protocol = tcp mirrored = yes
Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 3389 protocol = udp mirrored = yes

Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 1024 protocol = tcp mirrored = yes
Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 1024 protocol = udp mirrored = yes

Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 20168 protocol = tcp mirrored = yes
Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 20168 protocol = udp mirrored = yes

Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 1029 protocol = tcp mirrored = yes
Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 1029 protocol = udp mirrored = yes

Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 23 protocol = tcp mirrored = yes
Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 23 protocol = udp mirrored = yes
Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 21 protocol = tcp mirrored = yes
Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 21 protocol = udp mirrored = yes
Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 137 protocol = tcp mirrored = yes
Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 137 protocol = udp mirrored = yes
Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 138 protocol = tcp mirrored = yes
Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 138 protocol = udp mirrored = yes
Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 25 protocol = tcp mirrored = yes
Netsh ipsec static add filter filterlist = default filter srcaddr = any dstaddr = me dstport = 25 protocol = udp mirrored = yes
Netsh ipsec static add rule name = kill policy = default policy filterlist = default filter filteraction = block
Netsh ipsec static set policy name = default policy assign = y
Port closed by echo
If % rmain % = 1 goto main

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.