[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

批处理让启动项失效

  1. @echo off
  2. cls
  3. rem Copyright (C) 2003-05 Ansgar Wiechers & Torsten Mann
  4. rem Contact: admin@ntsvcfg.de
  5. rem
  6. rem This program is free software; you can redistribute it and/or modify it under
  7. rem the terms of the GNU General Public License as published by the Free Software Foundation;
  8. rem either version 2 of the License, or (at your option) any later version.
  9. rem This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  10. rem without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. rem See the GNU General Public License for more details.
  12. rem
  13. rem You should have received a copy of the GNU General Public License along with this program;
  14. rem if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  15. rem MA 02111-1307, USA.
  16. echo.
  17. REM Tested on ... WinXP_SP2
  18. REM Always basic XP64 Support
  19. REM Modifications to BITS service (cause of v5 WindowsUpdate) - #discharged#
  20. REM Additional notices corresponding to DHCP issue
  21. REM Variables problems during RESTORE_DEFAULT usage fixed
  22. REM SMBDEVICEENABLED Restore Bug fixed
  23. REM Mod_history-09-27-2005**11-08-2005**11-29-2005**12-07-2005**12-18-2005
  24. setlocal
  25. REM *** INIT_VARS ***
  26. set CHK_SVC=YES
  27. set XPSP2=FALSE
  28. set SERVER=FALSE
  29. set NT_SERVER_CHK=TRUE
  30. :START
  31. echo  "svc2kXp.cmd" v2.2_build7b (18.12.2005), published under GNU GPL
  32. echo  ================================================================
  33. set find=%SystemRoot%\System32\find.exe
  34. set regedit=%SystemRoot%\regedit.exe
  35. if not exist "%find%" goto :NOFIND
  36. if not exist "%regedit%" goto :NOREGEDIT
  37. if not "%1" == "%*" goto :SYNTAX
  38. if /I "%1"=="/?" goto :HELP
  39. if /I "%1"=="/help" goto :HELP
  40. if /I "%1"=="-h" goto :HELP
  41. if /I "%1"=="--help" goto :HELP
  42. if /I "%1"=="-?" goto :HELP
  43. if /I "%1"=="--?" goto :HELP
  44. if /I "%1"=="/fix" goto :FIX
  45. goto :VERSION
  46. :SYNTAX
  47. echo.
  48. echo.
  49. echo  !!Syntax error!!
  50. echo  ________________
  51. echo  Es kann nur ein oder kein Parameter angegeben werden.
  52. echo.
  53. echo  Only one or no parameter allowed.
  54. goto :QUIT
  55. :HELP
  56. echo.
  57. echo                                 -= Hilfe =-
  58. echo  Parameter:
  59. echo  /lan.......Einige Dienste fuer LAN-Betrieb werden nicht veraendert.
  60. echo  /std.......Schliesst alle Ports, einige Dienste bleiben unveraendert.
  61. echo  /all.......Setzt alle Vorschlaege nach www.ntsvcfg.de um (hardening).
  62. echo  /restore...Nimmt die zuletzt vorgenommenen Aenderungen zurueck.
  63. echo  /reLAN.....Reaktiviert Dienste, die fuer LAN-Betrieb benoetigt werden.
  64. echo  /default...Setzt alle Diensteinstellungen auf urspr黱gliche Werte zur點k.
  65. echo.
  66. echo  Parameters:
  67. echo  /lan.......Some services needed for LAN-usage stay unchanged!
  68. echo  /std.......Closes all Ports, but some services stay unchanged
  69. echo  /all.......Changes all issues recommended by www.ntsvcfg.de ("hardening")
  70. echo  /restore...Undo last changes.
  71. echo  /reLAN.....Reactivates services required for LAN.
  72. echo  /default...Restoring factory service settings (before first time usage)
  73. echo.
  74. echo  example: svc2kxp.cmd /all
  75. echo.
  76. set /P CHS= [Press "G" for GNU GPL informations or "Q" for quit]?
  77. if /I "%CHS%"=="G" goto :GNU_GPL
  78. if /I "%CHS%"=="Q" goto :QUIT_EXT
  79. CLS
  80. goto :HELP
  81. :GNU_GPL
  82. CLS
  83. echo  Informations about GNU-General Public License for "svc2kxp.cmd"
  84. echo  ===============================================================
  85. echo.
  86. echo  Copyright (C) 2003-05 Ansgar Wiechers, Torsten Mann
  87. echo  Contact: admin@ntsvcfg.de
  88. echo.
  89. echo  This program is free software; you can redistribute it and/or modify it under
  90. echo  the terms of the GNU General Public License as published by the Free Software
  91. echo  Foundation; either version 2 of the License, or (at your option) any later
  92. echo  version. This program is distributed in the hope that it will be useful, but
  93. echo  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  94. echo  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  95. echo  details.
  96. echo.
  97. echo  You should have received a copy of the GNU General Public License along with
  98. echo  this program; if not, write to the:
  99. echo.
  100. echo  Free Software Foundation, Inc.
  101. echo  59 Temple Place, Suite 330
  102. echo  Boston, MA 02111-1307, USA.
  103. echo.
  104. set /P CHS= [Press "H" for help or "Q" for quit]?
  105. CLS
  106. if /I "%CHS%"=="H" goto :HELP
  107. if /I "%CHS%"=="Q" goto :QUIT_EXT
  108. goto GNU_GPL
  109. :VERSION
  110. echo  Checking system version ...
  111. if /I "%NT_SERVER_CHK%"=="FALSE" goto :SKIP_NT_SERVER_CHK
  112. REM Checking for running server version
  113.         "%regedit%" /e "%TEMP%\~svr.txt" "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions"
  114.                  type "%TEMP%\~svr.txt"|"%find%" /i "Server" >NUL
  115.                 if not errorlevel 1 set SERVER=TRUE
  116.                  type "%TEMP%\~svr.txt"|"%find%" /i "LanMan" >NUL
  117.                 if not errorlevel 1 set SERVER=TRUE
  118.                 if exist "%TEMP%\~svr.txt" del /F /Q "%TEMP%\~svr.txt"
  119.                 if /I "%SERVER%"=="TRUE" goto :NTSERVER
  120. :SKIP_NT_SERVER_CHK
  121. ver | "%find%"  /i "Windows 2000" > nul
  122. if not errorlevel 1 goto :OS2K
  123. ver | "%find%"  /i "Windows XP" > nul
  124. if not errorlevel 1 goto :OSXP
  125. ver | "%find%"  /i "Microsoft Windows [Version 5.2.3790]" > nul
  126. if not errorlevel 1 goto :OSXP64
  127. echo  !!Failed!!
  128. echo  __________
  129. echo.
  130. echo  Dieses Script ist nur unter Windows 2000 oder XP lauffaehig!
  131. echo.
  132. echo  This script works only on Windows 2000/XP machines!
  133. echo.
  134. goto :QUIT
  135. :NOFIND
  136. echo.
  137. echo  !!Failed!!
  138. echo  __________
  139. echo.
  140. echo  Leider konnte folgende Datei nicht gefunden werden:
  141. echo.
  142. echo  Sorry, but following file is missing:
  143. echo.
  144. echo.
  145. echo  # %SystemRoot%\System32\FIND.EXE
  146. echo.
  147. echo.
  148. goto :QUIT
  149. :NOREGEDIT
  150. echo.
  151. echo  !!Failed!!
  152. echo  __________
  153. echo.
  154. echo  Leider konnte folgende Datei nicht gefunden werden:
  155. echo.
  156. echo  Sorry, but following file is missing:
  157. echo.
  158. echo.
  159. echo  # %SystemRoot%\REGEDIT.EXE
  160. echo.
  161. echo.
  162. goto :QUIT
  163. :NTSERVER
  164. echo.
  165. echo  !!Failed!!
  166. echo  __________
  167. echo.
  168. echo  Dieses Script unterstuetzt keine NT Server Versionen!
  169. echo.
  170. echo  This script doesn't support NT server versions!
  171. echo.
  172. goto :QUIT
  173. :OS2K
  174. rem Specific OS Detection I
  175. set SYSTEM=2k
  176. rem Testing for XP ServicePacks
  177.         "%regedit%" /e "%TEMP%\~svclist.txt" "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
  178.         type "%TEMP%\~svclist.txt"|"%find%" /i "Service Pack 4" >NUL
  179.         if errorlevel==1 (
  180.                   type "%TEMP%\~svclist.txt"|"%find%" /i "Service Pack 3" >NUL
  181.                   if errorlevel==1 (
  182.                         type "%TEMP%\~svclist.txt"|"%find%" /i "Service Pack 2" >NUL
  183.                           if errorlevel==1 (
  184.                                 type "%TEMP%\~svclist.txt"|"%find%" /i "Service Pack 1" >NUL
  185.                                 if errorlevel==1 (
  186.                                         echo  !Windows 2000 [no or unknown Service Pack] detected!
  187.                                         goto NO_2KSP
  188.                                         )
  189.                                 echo  !Windows 2000 [Service Pack 1] detected!
  190.                                   goto :NO_2KSP
  191.                                 )
  192.                         echo  !Windows 2000 [Service Pack 2] detected!
  193.                           goto :NO_2KSP
  194.                         )
  195.                 echo  !Windows 2000 [Service Pack 3] detected!
  196.                 goto :NO_2KSP
  197.                 )
  198.         echo  !Windows 2000 [Service Pack 4] detected!
  199.         goto :NO_2KSP
  200. :NO_2kSP
  201. if exist "%TEMP%\~svclist.txt" del /F /Q "%TEMP%\~svclist.txt"
  202. goto :CONTINUE
  203. :OSXP
  204. rem Specific OS detection II
  205. set SYSTEM=xp
  206. rem Testing for XP ServicePack 2
  207.         "%regedit%" /e "%TEMP%\~svclist.txt" "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
  208.         type "%TEMP%\~svclist.txt"|"%find%" /i "Service Pack 2" >NUL
  209.         if errorlevel==1 (
  210.                   type "%TEMP%\~svclist.txt"|"%find%" /i "Service Pack 1" >NUL
  211.                   if errorlevel==1 (
  212.                         SET XPSP2=FALSE
  213.                         echo  !Windows XP [no or unknown Service Pack] detected!
  214.                         goto NO_XPSP
  215.                         )
  216.                 SET XPSP2=FALSE
  217.                   echo  !Windows XP [Service Pack 1] detected!
  218.                   goto :NO_XPSP
  219.                 )
  220.         SET XPSP2=TRUE
  221.         echo  !Windows XP [ServicePack 2] detected!
  222.         goto :NO_XPSP
  223. :OSXP64
  224. rem Specific OS detection II
  225. set SYSTEM=xp
  226. rem Testing for XP ServicePack 2
  227.         "%regedit%" /e "%TEMP%\~svclist.txt" "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
  228.         type "%TEMP%\~svclist.txt"|"%find%" /i "Service Pack 2" >NUL
  229.         if errorlevel==1 (
  230.                   type "%TEMP%\~svclist.txt"|"%find%" /i "Service Pack 1" >NUL
  231.                   if errorlevel==1 (
  232.                         SET XPSP2=FALSE
  233.                         echo  !EXPERIMENTAL! Windows XP64 [no or unknown Service Pack] detected!
  234.                         goto NO_XPSP
  235.                         )
  236.                 SET XPSP2=FALSE
  237.                   echo  !EXPERIMENTAL! Windows XP64 [Service Pack 1] detected!
  238.                   goto :NO_XPSP
  239.                 )
  240.         SET XPSP2=TRUE
  241.         echo  !EXPERIMENTAL! Windows XP64 [ServicePack 2] detected!
  242.         goto :NO_XPSP
  243. :NO_XPSP
  244. if exist "%TEMP%\~svclist.txt" del /F /Q "%TEMP%\~svclist.txt"
  245. goto :CONTINUE
  246. :CONTINUE
  247. REM Creating subdirectory "ntsvcfg" in userprofile if necessary
  248. if not exist "%USERPROFILE%\ntsvcfg\*.*" mkdir "%USERPROFILE%\ntsvcfg"
  249. REM Moving old script backup files to ...\%USERNAME%\ntsvcfg :
  250.         if exist "%USERPROFILE%\dcom.reg" move /Y "%USERPROFILE%\dcom.reg" "%USERPROFILE%\ntsvcfg\dcom.reg"
  251.         if exist "%USERPROFILE%\dcomp.reg" move /Y "%USERPROFILE%\dcomp.reg" "%USERPROFILE%\ntsvcfg\dcomp.reg"
  252.         if exist "%USERPROFILE%\services.reg" move /Y "%USERPROFILE%\services.reg" "%USERPROFILE%\ntsvcfg\services.reg"
  253.         if exist "%USERPROFILE%\current_services_config.reg" move /Y "%USERPROFILE%\current_services_config.reg" "%USERPROFILE%\ntsvcfg\current_services_config.reg"
  254.         if exist "%USERPROFILE%\smb.reg" move /Y "%USERPROFILE%\smb.reg" "%USERPROFILE%\ntsvcfg\smb.reg"
  255.         if exist "%USERPROFILE%\FPRINT.REF" move /Y "%USERPROFILE%\FPRINT.REF" "%USERPROFILE%\ntsvcfg\FPRINT.REF"
  256.         if exist "%USERPROFILE%\handler_aim.reg" move /Y "%USERPROFILE%\handler_aim.reg" "%USERPROFILE%\ntsvcfg\handler_aim.reg"
  257.         if exist "%USERPROFILE%\handler_gopher.reg" move /Y "%USERPROFILE%\handler_gopher.reg" "%USERPROFILE%\ntsvcfg\handler_gopher.reg"
  258.         if exist "%USERPROFILE%\handler_telnet.reg" move /Y "%USERPROFILE%\handler_telnet.reg" "%USERPROFILE%\ntsvcfg\handler_telnet.reg"
  259.         if exist "%USERPROFILE%\services.reg.default" move /Y "%USERPROFILE%\services.reg.default" "%USERPROFILE%\ntsvcfg\services.reg.default"
  260.         if exist "%USERPROFILE%\dcom.reg.default" move /Y "%USERPROFILE%\dcom.reg.default" "%USERPROFILE%\ntsvcfg\dcom.reg.default"
  261.         if exist "%USERPROFILE%\dcomp.reg.default" move /Y "%USERPROFILE%\dcomp.reg.default" "%USERPROFILE%\ntsvcfg\dcomp.reg.default"
  262.         if exist "%USERPROFILE%\smb.reg.default" move /Y "%USERPROFILE%\smb.reg.default" "%USERPROFILE%\ntsvcfg\smb.reg.default"
  263.         if exist "%USERPROFILE%\handler_aim.reg.default" move /Y "%USERPROFILE%\handler_aim.reg.default" "%USERPROFILE%\ntsvcfg\handler_aim.reg.default"
  264.         if exist "%USERPROFILE%\handler_gopher.reg.default" move /Y "%USERPROFILE%\handler_gopher.reg.default" "%USERPROFILE%\ntsvcfg\handler_gopher.reg.default"
  265.         if exist "%USERPROFILE%\handler_telnet.reg.default" move /Y "%USERPROFILE%\handler_telnet.reg.default" "%USERPROFILE%\ntsvcfg\handler_telnet.reg.default"
  266. REM *****Declarations*****
  267. set SELECT="no"
  268. set SVC_BAK=%USERPROFILE%\ntsvcfg\services.reg
  269. set SVC_SAV=%USERPROFILE%\ntsvcfg\current_services_config.reg
  270. set DCOM_BAK=%USERPROFILE%\ntsvcfg\dcom.reg
  271. set DCOMP_BAK=%USERPROFILE%\ntsvcfg\dcomp.reg
  272. set SMB_BAK=%USERPROFILE%\ntsvcfg\smb.reg
  273. set DCOM_TMP=%TEMP%\dcomoff.reg
  274. set DCOMP_TMP=%TEMP%\dcompoff.reg
  275. set SMB_TMP=%TEMP%\smboff.reg
  276. set FPRINT=%USERPROFILE%\ntsvcfg\FPRINT.REF
  277. set HANDLER1=%USERPROFILE%\ntsvcfg\handler_aim.reg
  278. set HANDLER2=%USERPROFILE%\ntsvcfg\handler_gopher.reg
  279. set HANDLER3=%USERPROFILE%\ntsvcfg\handler_telnet.reg
  280. set NB_TMP=%TEMP%\nb_off.vbs
  281. set srctmp=%USERPROFILE%\ntsvcfg\~srcreate.vbs
  282. set DHCP_CHANGES="YES"
  283. REM *****Options*****
  284. set SCHEDULER_ENABLED=NO
  285. set UseXPSysRestore=YES
  286. set RESTORE=NO
  287. set SVC_MOD=NO
  288. set USE_FPRINT=YES
  289. set Deactivate_NetBIOS=YES
  290. set RESTORE_MODE=2
  291. REM *****APP_PATHs******
  292. set NET=%SystemRoot%\system32\net.exe
  293. set SC=%SystemRoot%\system32\sc.exe
  294. set FC=%SystemRoot%\system32\fc.exe
  295. set IPCONFIG=%SystemRoot%\system32\ipconfig.exe
  296. echo  Checking available permissions: [local], please wait ...
  297. "%net%" user "%USERNAME%" 2> nul | "%find%"  /i "admin" | "%find%"  /i /v "name" > nul
  298. if errorlevel 1 (
  299.         echo     "         "          "     : [domain], please wait ...
  300.         "%net%" user "%USERNAME%" /domain 2> nul | "%find%"  /i "admin" | "%find%"  /i /v "name" > nul
  301.         if errorlevel 1 (
  302.                 echo.
  303.                 echo  Failed!
  304.                 echo  __________
  305.                 echo  Leider verfuegen Sie nicht ueber die erforderlichen Rechte!
  306.                 echo  Melden Sie sich bitte als Administrator an.
  307.                 echo.
  308.                 echo  Sorry but you don't have the permissions required for this task.
  309.                 echo  Please login as Administrator.
  310.                 echo.
  311.                 goto :END
  312.                 )
  313.         )
  314. set IMPORT_OLD_FILES=FALSE
  315. rem searching for sc.exe
  316. if not exist "%FPRINT%" echo  Checking for presence of SC.EXE ...
  317. "%sc%" qc > nul 2>&1
  318. if errorlevel 1 (
  319.         echo  !!Failed!!
  320.         echo  __________
  321.         echo  Die notwendige Datei SC.EXE konnte leider nicht unter
  322.         echo  [%SystemRoot%\SYSTEM32\] gefunden werden.
  323.         echo  Bitte laden Sie sich diese Datei von der unten genannten Adresse herunter:
  324.         echo.
  325.         echo  SC.EXE couldn't be found in [%SystemRoot%\SYSTEM32\].
  326.         echo  Please download it from following location:
  327.         echo.
  328.         echo.
  329.         echo            -= ftp://ftp.microsoft.com/reskit/win2000/sc.zip =-
  330.         echo.
  331.         echo                                Self-installing SC.EXE
  332.         echo                                ======================
  333.         echo  svx2kxp.cmd kann versuchen, die notwendige Datei selbst zu installieren.
  334.         echo  Hierzu benoetigen Sie eine bestehende Internetverbindung.
  335.         echo.
  336.         echo  svc2kxp.cmd may try to download the required file SC.EXE itself if an
  337.         echo  active internet connection exists.
  338.         goto :SC_DOWNLOAD
  339.         )
  340. if /I "%1"=="/all" (
  341.         set SELECT="/all"
  342.         goto :SKIP_MENUE
  343.         )
  344. if /I "%1"=="/relan" (
  345.         set SELECT="/relan"
  346.         goto :SKIP_MENUE
  347.         )
  348. if /I "%1"=="/std" (
  349.         set SELECT="/std"
  350.         goto :SKIP_MENUE
  351.         )
  352. if /I "%1"=="/default" goto :RESTORE_DEFAULTS
  353. rem checking for modified services
  354. if /I %CHK_SVC%==YES (
  355.         if /I %USE_FPRINT%==YES (
  356.                 if exist "%FPRINT%" (
  357.                         rem Creating fingerprint of current service settings...
  358.                         if exist "%USERPROFILE%\ntsvcfg\svc2cmp.sav" del /F /Q "%USERPROFILE%\ntsvcfg\svc2cmp.sav"
  359.                         "%sc%" query type= service state= all bufsize= 8192 | %FIND% "SERVICE_NAME" >%TEMP%\~svclist.txt
  360.                         for /F "tokens=1*" %%a in (%TEMP%\~svclist.txt) do (
  361.                                 echo %%b >>"%USERPROFILE%\ntsvcfg\svc2cmp.sav"
  362.                                 "%sc%" query "%%b" | %FIND% "STATE" >>"%USERPROFILE%\ntsvcfg\svc2cmp.sav"
  363.                                 "%sc%" qc "%%b" | %FIND% "DISPLAY_NAME" >>"%USERPROFILE%\ntsvcfg\svc2cmp.sav"
  364.                                 "%SC%" qc "%%b" | %FIND% "START_TYPE" >>"%USERPROFILE%\ntsvcfg\svc2cmp.sav"
  365.                                 echo. >> "%USERPROFILE%\ntsvcfg\svc2cmp.sav"
  366.                                 )
  367.                         del "%TEMP%\~svclist.txt"
  368.                         "%FC%" "%FPRINT%" "%USERPROFILE%\ntsvcfg\svc2cmp.sav" >NUL
  369.                         if errorlevel 1 goto :DIFF
  370.                         goto OK
  371.                         :DIFF
  372.                         echo  Checking for modified services ... failed-services maybe modified! [E]valuate
  373.                         set SVC_MOD=YES
  374.                         goto :MOD_END
  375.                         :OK
  376.                         echo  Checking for modified services ... OK
  377.                         set SVC_MOD=NO
  378.                         if exist "%USERPROFILE%\ntsvcfg\svc2cmp.sav" del /F /Q "%USERPROFILE%\ntsvcfg\svc2cmp.sav"
  379.                         goto :MOD_END
  380.                         :MOD_END
  381.                         REM
  382.                         )
  383.                 )
  384.         )
  385. set CHK_SVC=NO
  386. if /I "%1"=="/restore" goto :RESTORE
  387. :MENUE
  388. if /I "%1"=="/lan" goto :SKIP_MENUE
  389. echo.
  390. echo                            -= Auswahl / Overview =-
  391. echo.
  392. echo  Bitte waehlen sie einen Punkt aus, den sie ausfuehren moechten:
  393. echo.
  394. echo  (1) LAN:       Einige Dienste fuer LAN-Betrieb werden nicht veraendert.
  395. echo  (2) Standard:  Schliesst alle Ports, aber einige Dienste bleiben unveraendert.
  396. echo  (3) ALL:       Setzt alle Vorschlaege nach www.ntsvcfg.de um (hardening).
  397. echo  (4) Restore:   Nimmt die zuletzt vorgenommenen Aenderungen zurueck.
  398. echo  ______________________________________________________________________________
  399. echo.
  400. echo  Please choose one task you want to do:
  401. echo.
  402. echo  (1) LAN:       Some services needed for LAN-usage stay unchanged
  403. echo  (2) Standard:  Close ports but some services stay unchanged
  404. echo  (3) ALL:       Making all changes described at www.ntsvcfg.de (hardening)
  405. echo  (4) restore:   Restores last changes made.
  406. echo.
  407. set /P CHS= Bitte waehlen Sie/Please choose: [1],[2],[3],[4], [M]ore options or [Q]uit?
  408. if /I "%CHS%"=="1" (
  409.         set SELECT="/lan"
  410.         goto :SKIP_MENUE
  411.         )
  412. if /I "%CHS%"=="2" (
  413.         set SELECT="/std"
  414.         goto :SKIP_MENUE
  415.         )
  416. if /I "%CHS%"=="3" (
  417.         set SELECT="/all"
  418.         goto :SKIP_MENUE
  419.         )
  420. if /I "%CHS%"=="4" goto :RESTORE
  421. if /I "%CHS%"=="R" goto :RESTORE
  422. if /I "%CHS%"=="M" goto :MORE_OPTIONS
  423. if /I "%SVC_MOD%"=="YES" if /I "%CHS%"=="E" goto :EVALUATE_SERVICES
  424. if /I "%CHS%"=="G" goto :CREATING_NEW_FINGERPRINT
  425. if /I "%CHS%"=="Q" goto :QUIT
  426. cls
  427. goto :START
  428. :SKIP_MENUE
  429. rem Checking if old restorefiles exists.
  430. rem if it is so old files will be restored before new changes
  431. if not exist "%SVC_BAK%" goto :NO_RESTORE
  432. if /I %RESTORE_MODE%==3 goto :NO_RESTORE
  433. if /I %RESTORE_MODE%==4 goto :NO_RESTORE
  434. set RESTORE=YES
  435. echo.
  436. echo  _______________________________________________________________________
  437. echo.
  438. echo  [Selected Restore Mode: %RESTORE_MODE%]
  439. echo.
  440. echo  # Achtung: Alte Sicherungsdateien gefunden!
  441. echo.
  442. echo     "Svc2kXp.cmd" wurde schon einmal ausgefuehrt. Damit neue Aenderungen
  443. echo     korrekt durchgefuehrt werden koennen, werden die Sicherungsdateien
  444. echo     eingespielt.
  445. echo.
  446. echo.
  447. echo    Attention: old restore-files found!
  448. echo.
  449. echo     This program runs not for the first time. To apply all new changes
  450. echo     correctly old restore files will used to get an definite state.
  451. echo.
  452. echo.
  453. echo  # Starting restore ...
  454. goto RESTORE_EXT
  455. :NO_RESTORE
  456. rem query if taskplaner should run
  457. if /I "%SYSTEM%"=="2k" goto :SKIP_SQUERY
  458. if /I "%SYSTEM%"=="xp" (
  459.         if /I %SELECT%=="" goto :SKIP_SQUERY
  460.         if /I %SELECT%=="/all" goto :SKIP_SQUERY
  461.         if /I %XPSP2%==True (
  462.                 set SCHEDULER_ENABLED=YES
  463.                 goto :SKIP_SQUERY
  464.                 )
  465.         )
  466. echo.
  467. echo.
  468. echo  Rueckfrage / Query
  469. echo  ==================
  470. echo.
  471. echo  Soll der Dienst "Taskplaner" beendet werden?
  472. echo.
  473. echo  Wenn sie zeitgesteuerten Aufgaben [z.B. Antiviren-Updates] oder die automati-
  474. echo  sche Erstellung von Systemwiederherstellungspunkten nicht benoetigen, druecken
  475. echo  Sie eine BELIEBIGE TASTE, um auch Port 135 [RPC] sowie Port 1025 [Taskplaner]
  476. echo  zu schliessen [empfohlen!]. Andernfalls druecken Sie "N"!
  477. echo.
  478. echo.
  479. echo  Should the "scheduler service" be disabled?
  480. echo.
  481. echo  If you have time-controlled tasks [i.e. AV-Updates] or you will not set
  482. echo  automatic system restore points press ANY KEY TO CONTINUE to close port 135
  483. echo  [RPC] and port 1025 [scheduler] instantly. Otherwise press "N"
  484. echo  ___________________________________________
  485. echo.
  486. set /P UNDO= Taskplaner beenden - Close scheduler [y/n]?
  487. if /I "%UNDO%"=="n" set SCHEDULER_ENABLED=YES
  488. :SKIP_SQUERY
  489. if not exist "%SVC_BAK%.default" (
  490.         echo.
  491.         echo  Creating backup of defaults ...
  492.         "%regedit%" /e "%SVC_BAK%.default" HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
  493.         "%regedit%" /e "%DCOM_BAK%.default" HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Ole
  494.         "%regedit%" /e "%DCOMP_BAK%.default" HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Rpc
  495.         "%regedit%" /e "%SMB_BAK%.default" HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters
  496.         "%regedit%" /e "%HANDLER1%.default" HKEY_CLASSES_ROOT\AIM
  497.         "%regedit%" /e "%HANDLER2%.default" HKEY_CLASSES_ROOT\gopher
  498.         "%regedit%" /e "%HANDLER3%.default" HKEY_CLASSES_ROOT\telnet
  499.         echo                             ... done.
  500.         )
  501. if exist "%SVC_BAK%" (
  502.         if /I %RESTORE_MODE%==2 goto :SKIP_SAVING
  503.         if /I %RESTORE_MODE%==4 goto :SKIP_SAVING
  504.         )
  505. rem saving registry settings
  506. echo  _________________________________________________________________________
  507. echo.
  508. echo  [Selected Restore Mode: %RESTORE_MODE%]
  509. echo.
  510. echo     Saving services settings to
  511. echo       %SVC_BAK% ...
  512. "%regedit%" /e "%SVC_BAK%" HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
  513. echo     Saving DCOM settings to
  514. echo       %DCOM_BAK% ...
  515. "%regedit%" /e "%DCOM_BAK%" HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Ole
  516. echo     Saving DCOM standard protocols settings to
  517. echo       %DCOMP_BAK% ...
  518. "%regedit%" /e "%DCOMP_BAK%" HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Rpc
  519. echo     Saving SMB settings to
  520. echo       %SMB_BAK%
  521. "%regedit%" /e "%SMB_BAK%" HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters
  522. echo     Saving URL-Handler [AIM, GOPHER, TELNET] to
  523. echo       %HANDLER1%
  524. "%regedit%" /e "%HANDLER1%" HKEY_CLASSES_ROOT\AIM
  525. echo       %HANDLER2%
  526. "%regedit%" /e "%HANDLER2%" HKEY_CLASSES_ROOT\gopher
  527. echo       %HANDLER3%
  528. "%regedit%" /e "%HANDLER3%" HKEY_CLASSES_ROOT\telnet
  529. echo.
  530. echo  All done.
  531. echo  ___________________________________________
  532. echo.
  533. :SKIP_SAVING
  534. if /I "%SYSTEM%"=="xp" (
  535.         if /I %UseXPSysRestore%==YES (
  536.                 goto :XPSYSRESTORE
  537.                 )
  538.         )
  539. :XPSYSRESTORE_DONE
  540. rem reconfigure services
  541. rem startup: demand
  542. echo.
  543. echo  Setting services to "demand" ...
  544. echo  ___________________________________________
  545. echo.
  546. echo  # Checking DHCP ...
  547. "%ipconfig%" -all | "%find%"  /i "Lease" > nul
  548. if errorlevel 1 (
  549.         rem trying other method for DHCP
  550.         "%ipconfig%" -all | "%find%"  /i "DHCP-Server" > nul
  551.         if errorlevel 1 (
  552.           echo                ... no active DHCP found.
  553.           echo.
  554.   echo  Hinweis
  555.   echo  =======
  556.   echo  Ihre Konfiguration deutet an, das kein DHCP benoetigt wird. Falls
  557.           echo  Sie dennoch einen DSL-Internetzugang besitzen und DHCP irrtuemlich
  558.   echo  deaktivert wurde, kann es nach einem Neustart zu Problemen mit der
  559.   echo  Internetverbindung kommen. Starten sie zur Problembehebung den
  560.   echo  DHCP-Dienst manuell neu.
  561.   echo.
  562.   echo  Notice
  563.   echo  ======
  564.   echo  Your configuration indicates that DHCP no longer will be required.
  565.   echo  But if you use a DSL internet connection this choice probably
  566.           echo  might be wrong. If you experiences problems during accessing the
  567.   echo  internet please re-activate the "DHCP Service" manually.
  568.   echo.
  569.   echo  ___________________________________________
  570.   echo.
  571.           "%sc%" config DHCP start= demand
  572.           goto :SKIP_DHCP
  573.         )
  574. )
  575. set DHCP_CHANGES="NO"
  576. echo  ... DHCP active, status of service will NOT be changed!
  577. echo.
  578. :SKIP_DHCP
  579. "%sc%" config dmadmin start= demand
  580. "%sc%" config DNSCache start= demand
  581. "%sc%" config mnmsrvc start= demand
  582. "%sc%" config MSIServer start= demand
  583. "%sc%" config NetDDE start= demand
  584. "%sc%" config NetDDEdsdm start= demand
  585. "%sc%" config Netman start= demand
  586. "%sc%" config NTLMSsp start= demand
  587. "%sc%" config NtmsSvc start= demand
  588. "%sc%" config PolicyAgent start= demand
  589. "%sc%" config RASAuto start= demand
  590. "%sc%" config RASMan start= demand
  591. "%sc%" config RSVP start= demand
  592. "%sc%" config Scardsvr start= demand
  593. "%sc%" query ScardDrv | "%find%"  /i "OpenService FAILED" >NUL
  594. if errorlevel 1 "%sc%" config ScardDrv start= demand
  595. if /I %XPSP2%==True (
  596.         rem If XP SP2 is installed there are less changes to XP-ICF
  597.         if /I %SELECT%=="/std" goto :SKIP_FIREWALL
  598.         )
  599. "%sc%" config SharedAccess start= demand
  600. :SKIP_FIREWALL
  601. "%sc%" config Sysmonlog start= demand
  602. "%sc%" config TAPISrv start= demand
  603. "%sc%" config TrkWks start= demand
  604. "%sc%" config UPS start= demand
  605. "%sc%" config W32Time start= demand
  606. "%sc%" config WMI start= demand
  607. if /I %SELECT%=="/all" (
  608.         "%sc%" config SamSs start= demand
  609.         "%sc%" config LmHosts start= demand
  610.         "%sc%" config Winmgmt start= demand
  611.         )
  612. if /I "%SYSTEM%"=="2k" (
  613.         "%sc%" config AppMgmt start= demand
  614.         "%sc%" config Browser start= demand
  615.         "%sc%" config clipsrv start= demand
  616.         "%sc%" config EventSystem start= demand
  617.         "%sc%" config Fax start= demand
  618.         "%sc%" config netlogon start= demand
  619.         "%sc%" config RPCLocator start= demand
  620.         "%sc%" config Utilman start= demand
  621.         if /I %SELECT%=="/all" (
  622.                 "%sc%" config seclogon start= demand
  623.                 "%sc%" config RPCSs start= demand
  624.                 "%sc%" config lanmanServer start= demand
  625.                 )
  626.         )
  627. if /I "%SYSTEM%"=="xp" (
  628.         "%sc%" config ALG start= demand
  629.         "%sc%" config FastUserSwitchingCompatibility start= demand
  630.         "%sc%" config helpsvc start= demand
  631.         "%sc%" config ImapiService start= demand
  632.         "%sc%" config Nla start= demand
  633.         "%sc%" config RdSessMgr start= demand
  634.         "%sc%" config seclogon start= demand
  635.         "%sc%" config stisvc start= demand
  636.         "%sc%" config SwPrv start= demand
  637.         "%sc%" config TermService start= demand
  638.         "%sc%" config upnphost start= demand
  639.         "%sc%" config VSS start= demand
  640.         "%sc%" query WmdmPmSp | "%find%"  /i "OpenService FAILED" >NUL
  641.         if errorlevel 1 "%sc%" config WmdmPmSp start= demand
  642.         "%sc%" config WmiApSrv start= demand
  643.         rem Wireless Zero Configuration - fuer WLAN-Verbindungen notwendig.
  644.         rem Falls erforderlich auf AUTO stellen.
  645.         rem "%sc%" config WZCSVC start= demand
  646.         )
  647. echo.
  648. rem startup: auto
  649. echo  Setting services to "auto" ...
  650. "%sc%" config dmserver start= auto
  651. "%sc%" config eventlog start= auto
  652. "%sc%" config PlugPlay start= auto
  653. "%sc%" config ProtectedStorage start= auto
  654. "%sc%" config sens start= auto
  655. "%sc%" config spooler start= auto
  656. if /I "%SYSTEM%"=="2k" (
  657.         "%sc%" config lanmanworkstation start= auto
  658.         "%sc%" config alerter start= auto
  659.         )
  660. if /I "%SYSTEM%"=="xp" (
  661.         "%sc%" query InteractiveLogon | "%find%"  /i "OpenService FAILED" >NUL
  662.         if errorlevel 1 "%sc%" config InteractiveLogon start= auto
  663.         "%sc%" config Audiosrv start= auto
  664.         "%sc%" config CryptSvc start= auto
  665.         "%sc%" config RPCSs start= auto
  666.         "%sc%" config ShellHWDetection start= auto
  667.         "%sc%" config srservice start= auto
  668.         "%sc%" query uploadmgr | "%find%"  /i "OpenService FAILED" >NUL
  669.         if errorlevel 1 "%sc%" config uploadmgr start= auto
  670.         "%sc%" config WebClient start= auto
  671.         )
  672. echo.
  673. rem startup: disabled
  674. echo  Setting services to "disabled" ...
  675. "%sc%" config cisvc start= disabled
  676. "%sc%" config MSDTC start= disabled
  677. "%sc%" config RemoteAccess start= disabled
  678. "%sc%" config TlntSvr start= disabled
  679. "%sc%" config messenger start= disabled
  680. if /I %SELECT%=="/all" (
  681.         "%sc%" query BITS | "%find%"  /i "SERVICE_NAME" >NUL
  682.         if not errorlevel 1 "%sc%" config BITS start= disabled
  683.         "%sc%" query wuauserv | "%find%"  /i "SERVICE_NAME" >NUL
  684.         if not errorlevel 1 "%sc%" config wuauserv start= disabled
  685.         "%sc%" config schedule start= disabled
  686.         "%sc%" config RemoteRegistry start= disabled
  687.         )
  688. if /I "%SYSTEM%"=="xp" (
  689.         "%sc%" config ERSvc start= disabled
  690.         "%sc%" config HidServ start= disabled
  691.         "%sc%" config SSDPSRV start= disabled
  692.         if /I %SELECT%=="/lan" (
  693.                 if /I %SCHEDULER_ENABLED%==NO "%sc%" config schedule start= disabled
  694.                 )
  695.         if /I %SELECT%=="/std" (
  696.                 if /I %SCHEDULER_ENABLED%==NO "%sc%" config schedule start= disabled
  697.                 )
  698.         if /I %XPSP2%==True (
  699.                 echo.
  700.                 echo  XPSP2: Disabling Security Center ...
  701.                 "%sc%" config wscsvc start= disabled
  702.                 )
  703.         )
  704. echo.
  705. echo  ------------------
  706. echo  # Checking and stopping unnecessary system services ...
  707. echo.
  708. "%sc%" query cisvc | "%find%"  /i "4  RUNNING" >NUL
  709.         if not errorlevel 1 "%net%" stop cisvc
  710. "%sc%" query RemoteAccess | "%find%"  /i "4  RUNNING" >NUL
  711.         if not errorlevel 1 "%net%" stop RemoteAccess
  712. "%sc%" query TlntSvr | "%find%"  /i "4  RUNNING" >NUL
  713.         if not errorlevel 1 "%net%" stop TlntSvr
  714. "%sc%" query MSDTC | "%find%"  /i "4  RUNNING" >NUL
  715.         if not errorlevel 1 "%net%" stop MSDTC
  716. "%sc%" query messenger | "%find%"  /i "4  RUNNING" >NUL
  717.         if not errorlevel 1 "%net%" stop messenger
  718. if /I %SELECT%=="/all" (
  719.         "%sc%" query BITS | "%find%"  /i "SERVICE_NAME" >NUL
  720.         if not errorlevel 1 (
  721.                 "%sc%" query BITS | "%find%"  /i "4  RUNNING" >NUL
  722.                 if not errorlevel 1 "%net%" stop BITS
  723.                 )
  724.         "%sc%" query wuauserv | "%find%"  /i "SERVICE_NAME" >NUL
  725.         if not errorlevel 1 (
  726.                 "%sc%" query wuauserv | "%find%"  /i "4  RUNNING" >NUL
  727.                 if not errorlevel 1 "%net%" stop wuauserv
  728.                 )
  729.         "%sc%" query schedule | "%find%"  /i "4  RUNNING" >NUL
  730.         if not errorlevel 1 "%net%" stop schedule
  731.         )
  732. if /I "%SYSTEM%"=="xp" (
  733.         if /I %SELECT%=="/lan" (
  734.                 if /I %SCHEDULER_ENABLED%==NO "%net%" (
  735.                         "%sc%" query schedule | "%find%"  /i "4  RUNNING" >NUL
  736.                         if not errorlevel 1 "%net%" stop schedule
  737.                         )
  738.                 )
  739.         if /I %SELECT%=="/std" (
  740.                 if /I %SCHEDULER_ENABLED%==NO "%net%" (
  741.                         "%sc%" query schedule | "%find%"  /i "4  RUNNING" >NUL
  742.                         if not errorlevel 1 "%net%" stop schedule
  743.                 )
  744.         if /I %XPSP2%==True (
  745.                 "%sc%" query wscsvc | "%find%"  /i "4  RUNNING" >NUL
  746.                 if not errorlevel 1 "%net%" stop wscsvc
  747.                 )
  748.         )
  749. echo  ------------------
  750. echo  Disabling DCOM ...
  751. echo REGEDIT4 > "%DCOM_TMP%"
  752. echo. >> "%DCOM_TMP%"
  753. echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Ole] >> "%DCOM_TMP%"
  754. echo "EnableDCOM"="N" >> "%DCOM_TMP%"
  755. echo "EnableDCOMHTTP"="N" >> "%DCOM_TMP%"
  756. echo. >> "%DCOM_TMP%"
  757. echo. >> "%DCOM_TMP%"
  758. "%regedit%" /s "%DCOM_TMP%"
  759. del /F /Q "%DCOM_TMP%"
  760. echo  Disabling DCOM standard protocols ...
  761. echo REGEDIT4 > "%DCOMP_TMP%"
  762. echo. >> "%DCOMP_TMP%"
  763. echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Rpc] >> "%DCOMP_TMP%"
  764. echo "DCOM Protocols"=hex(7):00,00,00,00 >> "%DCOMP_TMP%"
  765. echo. >> "%DCOMP_TMP%"
  766. echo. >> "%DCOMP_TMP%"
  767. "%regedit%" /s "%DCOMP_TMP%"
  768. del /F /Q "%DCOMP_TMP%"
  769.    echo  Disabling port 135 (maybe 1025 too) ...
  770.    echo    - Removing RPC Client Protocols
  771.    echo REGEDIT4 > "%SMB_TMP%"
  772.    echo [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Rpc\ClientProtocols] >> "%SMB_TMP%"
  773.    echo. >> "%SMB_TMP%"
  774.    if /I %SCHEDULER_ENABLED%==NO (
  775.     echo    - Advanced RPC Configuration
  776.     echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Rpc\Internet] >> "%SMB_TMP%"
  777.     echo "PortsInternetAvailable"="N" >> "%SMB_TMP%"
  778.     echo "UseInternetPorts"="N" >> "%SMB_TMP%"
  779.     echo. >> "%SMB_TMP%"
  780.     )
  781.    if /I %XPSP2%==TRUE (
  782.     echo    - Advanced RPC Configuration
  783.     echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Rpc\Internet] >> "%SMB_TMP%"
  784.     echo "PortsInternetAvailable"="N" >> "%SMB_TMP%"
  785.     echo "UseInternetPorts"="N" >> "%SMB_TMP%"
  786.     echo. >> "%SMB_TMP%"
  787.     )
  788.    echo    - Removing needless URL Handler [AIM,gopher,telnet]
  789.    echo [-HKEY_CLASSES_ROOT\AIM] >> "%SMB_TMP%"
  790.    echo [-HKEY_CLASSES_ROOT\gopher] >> "%SMB_TMP%"
  791.    echo [-HKEY_CLASSES_ROOT\telnet] >> "%SMB_TMP%"
  792.    echo. >> "%SMB_TMP%"
  793.    echo. >> "%SMB_TMP%"
  794.   "%regedit%" /s "%SMB_TMP%"
  795.   del /F /Q "%SMB_TMP%"
  796. if /I %SELECT%=="/all" (
  797.         echo.
  798.         echo  Disabling SMB port 445 ...
  799.         echo REGEDIT4 > "%SMB_TMP%"
  800.         echo. >> "%SMB_TMP%"
  801.         echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters] >> "%SMB_TMP%"
  802.         echo "SMBDeviceEnabled"=dword:00000000 >> "%SMB_TMP%"
  803.         echo. >> "%SMB_TMP%"
  804.         echo. >> "%SMB_TMP%"
  805.         "%regedit%" /s "%SMB_TMP%"
  806.         del /F /Q "%SMB_TMP%"
  807.         set REBOOT_REQUIRED=yes
  808.         )
  809. if /I %SELECT%=="/std" (
  810.         echo.
  811.         echo  Disabling SMB port 445 ...
  812.         echo REGEDIT4 > "%SMB_TMP%"
  813.         echo. >> "%SMB_TMP%"
  814.         echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters] >> "%SMB_TMP%"
  815.         echo "SMBDeviceEnabled"=dword:00000000 >> "%SMB_TMP%"
  816.         echo. >> "%SMB_TMP%"
  817.         echo. >> "%SMB_TMP%"
  818.         "%regedit%" /s "%SMB_TMP%"
  819.         del /F /Q "%SMB_TMP%"
  820.         set REBOOT_REQUIRED=yes
  821.         )
  822. if /I %SELECT%=="/std" goto :NB_DISABLE
  823. if /I %SELECT%=="/all" goto :NB_DISABLE
  824. goto :SKIP_NB_DISABLE
  825. :NB_DISABLE
  826.   if /I %DEACTIVATE_NETBIOS%==NO (
  827.                 echo.
  828.                 echo.  Due problems with SP2 and deactivating NetBIOS this option
  829.                 echo   will be skipped.
  830.                 echo.
  831.                 goto :SKIP_NB_DISABLE
  832.                 )
  833.   rem Because of problems with SP2 Netbios:
  834.   if /I %XPSP2%==True (
  835.                 echo.
  836.                 echo  Note:
  837.                 echo  -----
  838.                 echo  If you experiencing problems after updating Windows XP with
  839.                 echo  Service Pack 2 please do following:
  840.                 echo.
  841.                 echo                          set Deactivate_NetBIOS=NO
  842.                 echo.
  843.                 )
  844.   rem *** Thx2 Johannes Lichtenberger for the following lines using VBScript***
  845.   echo  Disable NetBios on all local interfaces ...
  846.   echo.
  847.   echo On Error Resume Next>> "%nb_tmp%"
  848.   echo.>> "%nb_tmp%"
  849.   echo TcpipoverNetbios = 2 '0=NetbiosfromDHCP 1=EnableNetbios 2=DisableNetbios>> "%nb_tmp%"
  850.   echo.>> "%nb_tmp%"
  851.   echo strComputer = ".">> "%nb_tmp%"
  852.   echo Set objWMIService = GetObject("winmgmts:\\" ^& strComputer ^& "\root\cimv2")>> "%nb_tmp%"
  853.   echo Set objNICs = objWMIService.ExecQuery _>> "%nb_tmp%"
  854.   echo    ("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")>> "%nb_tmp%"
  855.   echo For Each objNic In objNICs>> "%nb_tmp%"
  856.   echo    errTcpipNetbios = objNic.SetTCPIPNetBIOS(TcpipoverNetbios)>> "%nb_tmp%"
  857.   echo Next>> "%nb_tmp%"
  858.   "%SYSTEMROOT%\SYSTEM32\CSCRIPT.EXE" "%nb_tmp%"
  859.   del /F /Q "%nb_tmp%"
  860.   set REBOOT_REQUIRED=yes
  861. :SKIP_NB_DISABLE
  862. rem Skip Billboard because /all is used
  863. if /I %SELECT%=="/all" goto :SW_ALL
  864. if /I %SELECT%=="/std" goto :SW_ALL
  865. if /I %SELECT%=="/relan" goto :SW_ALL
  866. echo.
  867. echo  ___________________________________________________________________
  868. echo.
  869. echo                   *** Zusammenfassung / Result ***
  870. echo.
  871. echo  Es wurden NICHT alle Aenderungen umgesetzt!
  872. echo  Um alle Vorschlaege von kssysteme.de umzusetzen, verwenden Sie
  873. echo  bitte den Parameter '/all' oder waehlen Sie im Menue den Punkt "3".
  874. if /I %DHCP_CHANGES%=="YES" (
  875.           echo.
  876.    echo  Wichtiger DHCP Hinweis
  877.    echo  ======================
  878.    echo  Ihre Konfiguration deutete an, das kein DHCP benoetigt wird. Falls
  879.           echo  Sie jedoch einen DSL-Internetzugang besitzen und DHCP irrtuemlich
  880.    echo  deaktivert wurde, kann es nach einem Neustart zu Problemen mit der
  881.    echo  Internetverbindung kommen. Starten sie zur Problembehebung den
  882.    echo  DHCP-Dienst von Hand neu.
  883.    echo.
  884. )
  885. echo.
  886. echo  Not all changes could be performed. To change all issues listed
  887. echo  on www.ntsvcfg.de please use parameter '/all' or select item "3"!
  888. if /I %DHCP_CHANGES%=="YES" (
  889.           echo.
  890.    echo  Important DHCP Notice
  891.    echo  =====================
  892.    echo  Your configuration indicates that DHCP will no longer be required.
  893.    echo  But if you are using a DSL internet connection this choice probably
  894.           echo  might be wrong. If you experiences problems during accessing the
  895.    echo  internet please re-activate the "DHCP Service" manually.
  896. echo.
  897. )
  898. echo  ___________________________________________________________________
  899. :SW_ALL
  900. if /I %SELECT%=="/relan" (
  901.         rem startup: auto
  902.         echo.
  903.         echo  ------------------
  904.         echo  Re-enabling services ...
  905.         "%sc%" config LmHosts  start= auto
  906.         "%sc%" config RemoteRegistry start= auto
  907.         "%sc%" config SamSs start= auto
  908.         "%sc%" config Winmgmt start= auto
  909.         if /I "%SYSTEM%"=="2k" (
  910.                 "%sc%" config RPCSs start= auto
  911.                 "%sc%" config lanmanServer start= auto
  912.                 "%sc%" config seclogon start= auto
  913.                 )
  914.         if /I "%SYSTEM%"=="XP" (
  915.                 rem "%sc%" config SharedAccess start= auto
  916.                 )
  917.         rem start re-enabled services
  918.         echo.
  919.         echo  ------------------
  920.         echo  [Re]starting services ...
  921.         echo.
  922.         "%sc%" query RemoteRegistry | "%find%"  /i "1  STOPPED" >NUL
  923.         if not errorlevel 1 "%net%" start RemoteRegistry
  924.         "%sc%" query SamSs | "%find%"  /i "1  STOPPED" >NUL
  925.         if not errorlevel 1 "%net%" start SamSs
  926.         "%sc%" query LmHosts | "%find%"  /i "1  STOPPED" >NUL
  927.         if not errorlevel 1 "%net%" start LmHosts
  928.         "%sc%" query Winmgmt | "%find%"  /i "1  STOPPED" >NUL
  929.         if not errorlevel 1 "%net%" start Winmgmt
  930.         if /I "%SYSTEM%"=="2k" (
  931.                 "%sc%" query LanmanServer | "%find%"  /i "1  STOPPED" >NUL
  932.                 if not errorlevel 1 "%net%" start lanmanServer
  933.                 "%sc%" query RPCSs | "%find%"  /i "1  STOPPED" >NUL
  934.                 if not errorlevel 1 "%net%" start RPCSs
  935.                 "%sc%" query Seclogon | "%find%"  /i "1  STOPPED" >NUL
  936.                 if not errorlevel 1 "%net%" start seclogon
  937.                 )
  938.         if /I "%SYSTEM%"=="XP" (
  939.                 rem "%net%" start SharedAccess
  940.                 )
  941.         rem enable SMB port 445
  942.         echo.
  943.         echo  ------------------
  944.         echo  Enabling SMB port 445 ...
  945.         echo REGEDIT4 > "%SMB_TMP%"
  946.         echo. >> "%SMB_TMP%"
  947.         echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters] >> "%SMB_TMP%"
  948.         echo "SMBDeviceEnabled"=dword:00000001 >> "%SMB_TMP%"
  949.         echo. >> "%SMB_TMP%"
  950.         echo. >> "%SMB_TMP%"
  951.         "%regedit%" /s "%SMB_TMP%"
  952.         del /F /Q "%SMB_TMP%"
  953.         set REBOOT_REQUIRED=yes
  954.         )
  955. rem Creating fingerprint of current service settings...
  956. if exist "%FPRINT%" del /F /Q "%FPRINT%"
  957. if /I %USE_FPRINT%==YES (
  958.         echo.
  959.         echo  Creating fingerprint which will take a few seconds ...
  960.         "%sc%" query type= service state= all bufsize= 8192 | %FIND% "SERVICE_NAME" > %TEMP%\~svclist.txt
  961.         for /F "tokens=1*" %%a in (%TEMP%\~svclist.txt) do (
  962.                 echo %%b >>"%FPRINT%"
  963.                 "%sc%" query "%%b" | %FIND% "STATE" >>"%FPRINT%"
  964.                 "%sc%" qc "%%b" | %FIND% "DISPLAY_NAME" >>"%FPRINT%"
  965.                 "%SC%" qc "%%b" | %FIND% "START_TYPE" >>"%FPRINT%"
  966.                 echo. >> "%FPRINT%"
  967.                 )
  968.         del "%TEMP%\~svclist.txt"
  969.         echo                                                      ... done.
  970.         )
  971. goto :END
  972. :RESTORE
  973. echo  ____________________________________________________
  974. echo.
  975. echo  Letzte Aenderungen zuruecknehmen [y/n]?
  976. set /P UNDO= Undo last changes [y/n]?
  977. if /I "%UNDO%"=="y" (
  978.         echo  _______________________________________________________________
  979.         echo.
  980.         echo  Hinweis:
  981.         echo  ========
  982.         echo  Moeglicherweise meldet Windows Fehler beim Importieren.
  983.         echo  Ignorieren Sie diese mit Klick auf "OK".
  984.         echo.
  985.         echo  Windows might probably report an error during importing the
  986.         echo  backups. Just ignore this by clicking the "OK" button!
  987.         echo  _______________________________________________________________
  988.         echo  Status:
  989.         echo  -------
  990.         :RESTORE_EXT
  991.         if exist "%SVC_BAK%" (
  992.                 echo     Importing services ...
  993.                 echo        ["%SVC_BAK%"]
  994.                 "%regedit%" /s "%SVC_BAK%"
  995.                 set action=""
  996.                 )
  997.         if exist "%DCOM_BAK%" (
  998.                 echo     Importing DCOM ...
  999.                 echo        ["%DCOM_BAK%"]
  1000.                 "%regedit%" /s "%DCOM_BAK%"
  1001.                 )
  1002.         if exist "%DCOMP_BAK%" (
  1003.                 echo     Importing DCOM-standard protocols ...
  1004.                 echo        ["%DCOMP_BAK%"]
  1005.                 "%regedit%" /s "%DCOMP_BAK%"
  1006.                 )
  1007.         if exist "%SMB_BAK%" (
  1008.                 echo     Importing SMB-settings ...
  1009.                 echo        ["%SMB_BAK%"]
  1010.          echo   - Removing SMBDeviceEnabled RegKey ...
  1011. echo REGEDIT4 > "%USERPROFILE%\smbpatch~.reg"
  1012. echo. >> "%USERPROFILE%\smbpatch~.reg"
  1013. echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters] >> "%USERPROFILE%\smbpatch~.reg"
  1014. echo "SMBDeviceEnabled"=- >> "%USERPROFILE%\smbpatch~.reg"
  1015. echo. >> "%USERPROFILE%\smbpatch~.reg"
  1016. echo. >> "%USERPROFILE%\smbpatch~.reg"
  1017. "%SystemRoot%\regedit.exe" /s "%USERPROFILE%\smbpatch~.reg"
  1018. del /F /Q "%USERPROFILE%\smbpatch~.reg"
  1019.                 "%regedit%" /s "%SMB_BAK%"
  1020.                 )
  1021.         if exist "%HANDLER1%" (
  1022.                 echo     Importing URL_HANDLER AIM ...
  1023.                 echo        ["%HANDLER1%"]
  1024.                 "%regedit%" /s "%HANDLER1%"
  1025.                 )
  1026.         if exist "%HANDLER2%" (
  1027.                 echo     Importing URL_HANDLER GOPHER ...
  1028.                 echo        ["%HANDLER2%"]
  1029.                 "%regedit%" /s "%HANDLER2%"
  1030.                 )
  1031.         if exist "%HANDLER3%" (
  1032.                 echo     Importing URL_HANDLER TELNET ...
  1033.                 echo        ["%HANDLER3%"]
  1034.                 "%regedit%" /s "%HANDLER3%"
  1035.                 )
  1036.         rem Skipping back to next state
  1037.         if /I "%RESTORE%"=="YES" goto :NO_RESTORE
  1038.         echo     Removing RPC Internet key ....
  1039.         echo REGEDIT4 >"%USERPROFILE%\svc_fix.reg"
  1040.         echo. >>"%USERPROFILE%\svc_fix.reg"
  1041.         echo [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Rpc\Internet] >>"%USERPROFILE%\svc_fix.reg"
  1042.         echo. >>"%USERPROFILE%\svc_fix.reg"
  1043.         echo. >>"%USERPROFILE%\svc_fix.reg"
  1044.         "%regedit%" /s "%USERPROFILE%\svc_fix.reg"
  1045.         del /F /Q "%USERPROFILE%\svc_fix.reg"
  1046.         rem Creating fingerprint of current service settings...
  1047.         if exist "%FPRINT%" del /F /Q "%FPRINT%"
  1048.         if /I %USE_FPRINT%==YES (
  1049.                 echo.
  1050.                 echo  Creating fingerprint which will take a few seconds ...
  1051.                 "%sc%" query type= service state= all bufsize= 8192 | %FIND% "SERVICE_NAME" > %TEMP%\~svclist.txt
  1052.                 for /F "tokens=1*" %%a in (%TEMP%\~svclist.txt) do (
  1053.                         echo %%b >>"%FPRINT%"
  1054.                         "%sc%" query "%%b" | %FIND% "STATE" >>"%FPRINT%"
  1055.                         "%sc%" qc "%%b" | %FIND% "DISPLAY_NAME" >>"%FPRINT%"
  1056.                         "%SC%" qc "%%b" | %FIND% "START_TYPE" >>"%FPRINT%"
  1057.                         echo. >> "%FPRINT%"
  1058.                         )
  1059.                 del "%TEMP%\~svclist.txt"
  1060.                 echo                                                      ... done.
  1061.                 )
  1062.         echo.
  1063.         echo  _______________________________________________________________
  1064.         echo.
  1065.         echo               *** Zusammenfassung / Result ***
  1066.         echo.
  1067.         echo  Die Ruecksicherung wurde ausgefuehrt. Wenn in der oberen Zeile
  1068.         echo  keine Statusmeldungen zu sehen sind, existierten keine rueckzu-
  1069.         echo  sichernden Dateien. Aktivieren Sie gegebenenfalls NetBios in
  1070.         echo  den Eigenschaften der jeweiligen Netzwerkkarte.
  1071.         echo  Bitte starten Sie abschliessend Ihren Rechner neu.
  1072.         echo.
  1073.         echo  Restore finished. If you don't see any messages in the status
  1074.         echo  box above, there were no files to restore. Please reactivate
  1075.         echo  NetBios for each NIC you want use with it and reboot afterwards.
  1076.         echo  ________________________________________________________________
  1077.         )
  1078. goto :END
  1079. :RESTORE_DEFAULTS
  1080. echo.
  1081. echo                     *** Restore Factory Settings ***
  1082. echo.
  1083. echo  ______________________________________________________________________________
  1084. echo.
  1085. echo  Einstellungen vor Erstanwendung des Scripts wiederherstellen (ausser NetBIOS)?
  1086. set /P UNDO= Restore defaults (before using script, except NetBIOS) [y/n]?
  1087. if /I "%UNDO%"=="y" (
  1088.         echo.
  1089.         echo   - Restoring original service settings [if exists] ...
  1090.         if exist "%SVC_BAK%.default" (
  1091. echo      "%SVC_BAK%.default"
  1092. "%regedit%" /s "%SVC_BAK%.default"
  1093. )
  1094.         if exist "%DCOM_BAK%.default" (
  1095. echo      "%DCOM_BAK%.default"
  1096. "%regedit%" /s "%DCOM_BAK%.default"
  1097. )
  1098.         if exist "%DCOMP_BAK%.default" (
  1099. echo      "%DCOMP_BAK%.default"
  1100. "%regedit%" /s "%DCOMP_BAK%.default"
  1101. )
  1102.         if exist "%SMB_BAK%.default" (
  1103. echo      "%SMB_BAK%.default"
  1104.          echo   - Removing SMBDeviceEnabled RegKey ...
  1105. echo REGEDIT4 > "%USERPROFILE%\smbpatch~.reg"
  1106. echo. >> "%USERPROFILE%\smbpatch~.reg"
  1107. echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters] >> "%USERPROFILE%\smbpatch~.reg"
  1108. echo "SMBDeviceEnabled"=- >> "%USERPROFILE%\smbpatch~.reg"
  1109. echo. >> "%USERPROFILE%\smbpatch~.reg"
  1110. echo. >> "%USERPROFILE%\smbpatch~.reg"
  1111. "%SystemRoot%\regedit.exe" /s "%USERPROFILE%\smbpatch~.reg"
  1112. del /F /Q "%USERPROFILE%\smbpatch~.reg"
  1113. "%regedit%" /s "%SMB_BAK%.default"
  1114. )
  1115.         if exist "%HANDLER1%.default" (
  1116. echo      "%HANDLER1%.default"
  1117. "%regedit%" /s "%HANDLER1%.default"
  1118. )
  1119.         if exist "%HANDLER2%.default" (
  1120. echo   "%HANDLER2%.default"
  1121. "%regedit%" /s "%HANDLER2%.default"
  1122. )
  1123.         if exist "%HANDLER3%.default" (
  1124. echo "%HANDLER3%.default"
  1125. "%regedit%" /s "%HANDLER3%.default"
  1126. )
  1127.         echo                                                 ... done.
  1128.         echo   - Removing RPC Internet key ...
  1129.         echo REGEDIT4 >"%USERPROFILE%\svc_fix.reg"
  1130.         echo. >>"%USERPROFILE%\svc_fix.reg"
  1131.         echo [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Rpc\Internet] >>"%USERPROFILE%\svc_fix.reg"
  1132.         echo. >>"%USERPROFILE%\svc_fix.reg"
  1133.         echo. >>"%USERPROFILE%\svc_fix.reg"
  1134.         "%regedit%" /s "%USERPROFILE%\svc_fix.reg"
  1135.         del /F /Q "%USERPROFILE%\svc_fix.reg"
  1136.         echo                                                 ... done.
  1137.         )
  1138. goto :QUIT
  1139. :SC_DOWNLOAD
  1140. echo  ______________________________________________________________
  1141. echo.
  1142. echo  Besteht eine aktive Internetverbindung?
  1143. echo  Are you currently connected to the internet?
  1144. echo.
  1145. set /P UNDO= Bitte waehlen/Please choose: [y/n]?
  1146.   if /I "%UNDO%"=="y" goto :SC_DOWNLOAD_OK
  1147. goto :END
  1148. :SC_DOWNLOAD_OK
  1149. if exist "%SYSTEMROOT%\sc.zip" goto :SCE
  1150. echo  Generating FTP-script ...
  1151. if exist "%USERPROFILE%"\script_sc.ls del /F "%USERPROFILE%\script_sc.ls"
  1152. echo open 207.46.133.140 >"%USERPROFILE%\script_sc.ls"
  1153. echo user anonymous anonymous@aol.com >>"%USERPROFILE%\script_sc.ls"
  1154. echo type binary >>"%USERPROFILE%\script_sc.ls"
  1155. echo user anonymous anonymous@aol.com >>"%USERPROFILE%\script_sc.ls"
  1156. echo type binary >>"%USERPROFILE%\script_sc.ls"
  1157. echo get /reskit/win2000/sc.zip "%SYSTEMROOT%\System32\SC.ZIP" >>"%USERPROFILE%\script_sc.ls"
  1158. echo quit >>"%USERPROFILE%\script_sc.ls"
  1159. echo  Downloading SC.EXE ...
  1160. ftp -s:"%USERPROFILE%\script_sc.ls"
  1161. del /F "%USERPROFILE%\script_sc.ls"
  1162. :SCE
  1163. if exist "%SYSTEMROOT%\System32\pkunzip.exe" goto :PKE
  1164. echo  Generating FTP-script ...
  1165. if exist "%USERPROFILE%"\script_pk.ls del /F "%USERPROFILE%\script_pk.ls"
  1166. echo open ftp.uni-duesseldorf.de >"%USERPROFILE%\script_pk.ls"
  1167. echo user anonymous anonymous@aol.com >>"%USERPROFILE%\script_pk.ls"
  1168. echo type binary >>"%USERPROFILE%\script_pk.ls"
  1169. echo user anonymous anonymous@aol.com >>"%USERPROFILE%\script_pk.ls"
  1170. echo type binary >>"%USERPROFILE%\script_pk.ls"
  1171. echo get /pub/ie/pkunzip.exe "%SYSTEMROOT%\System32\pkunzip.exe" >>"%USERPROFILE%\script_pk.ls"
  1172. echo quit >>"%USERPROFILE%\script_pk.ls"
  1173. echo  Downloading PKUNZIP.EXE ...
  1174. ftp -s:"%USERPROFILE%\script_pk.ls"
  1175. del /F "%USERPROFILE%\script_pk.ls"
  1176. :PKE
  1177. if not exist "%SYSTEMROOT%\System32\sc.zip" (
  1178.         echo.
  1179.         echo   Download fehlgeschlagen. Bitte laden sie sich die Datei SC.ZIP manuell
  1180.         echo   herunter und kopieren diese nach %SYSTEMROOT%\.
  1181.         echo.
  1182.         echo   Downloading SC.ZIP failed. Please download it manually an copy it to
  1183.         echo   %SYSTEMROOT%\.
  1184.         )
  1185. if not exist "%SYSTEMROOT%\System32\pkunzip.exe" (
  1186.         echo.
  1187.         echo   Die Datei PKUNZIP.EXE konnte nicht gefunden werden. Diese wird zum
  1188.         echo   Entpacken des Archivs SC.ZIP benoetigt!
  1189.         echo.
  1190.         echo   File PKUNZIP.EXE not found. It is needed to decompress the archive SC.EXE.
  1191.         )
  1192. if exist "%SYSTEMROOT%\System32\SC.ZIP" (
  1193.         if exist "%SYSTEMROOT%\System32\pkunzip.exe" (
  1194.                 "%SYSTEMROOT%\System32\pkunzip.exe" -e "%SYSTEMROOT%\System32\sc.zip" sc.exe
  1195.                 )
  1196.         )
  1197. move /Y sc.exe "%SYSTEMROOT%\System32\"
  1198. echo.
  1199. echo  Skript wird neu gestartet ...
  1200. echo  Restarting script ...
  1201. goto :START
  1202. :FIX
  1203. echo.
  1204. echo                     -= svc2kxp.cmd taskplaner fix =-
  1205. echo.
  1206. echo.
  1207. echo  Druecken Sie "Y", um das Problem mit dem Taskplaner ("falscher Parameter")
  1208. echo  unter Windows XP zu beheben.
  1209. echo.
  1210. echo  Press "Y", if you want fix issue "scheduler doesn't start under Windows XP
  1211. echo  after running script v2.0 - v2.1build0".
  1212. echo.
  1213. set /P UNDO= Fix problem [y/n]?
  1214. if /I "%UNDO%"=="y" (
  1215.         echo REGEDIT4 >"%USERPROFILE%\svc_fix.reg"
  1216.         echo. >>"%USERPROFILE%\svc_fix.reg"
  1217.         echo [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Rpc\Internet] >>"%USERPROFILE%\svc_fix.reg"
  1218.         echo. >>"%USERPROFILE%\svc_fix.reg"
  1219.         echo. >>"%USERPROFILE%\svc_fix.reg"
  1220.         "%regedit%" /s "%USERPROFILE%\svc_fix.reg"
  1221.         del /F /Q "%USERPROFILE%\svc_fix.reg"
  1222.         echo  ______________________________________
  1223.         echo  OK. Bitte starten Sie den Rechner neu und kontrollieren Sie erneut,
  1224.         echo  ob hierdurch Ports geoeffnet wurden.
  1225.         echo.
  1226.         echo  Done. Please reboot and check again for open ports ...!
  1227.         )
  1228. rem Creating fingerprint of current service settings...
  1229. if exist "%FPRINT%" del /F /Q "%FPRINT%"
  1230. goto quit
  1231. if /I %USE_FPRINT%==YES (
  1232.         echo.
  1233.           echo  Creating fingerprint which will take a few seconds ...
  1234.           "%sc%" query type= service state= all bufsize= 8192 | %FIND% "SERVICE_NAME" > %TEMP%\~svclist.txt
  1235.           for /F "tokens=1*" %%a in (%TEMP%\~svclist.txt) do (
  1236.                 echo %%b >>"%FPRINT%"
  1237.                 "%sc%" query "%%b" | %FIND% "STATE" >>"%FPRINT%"
  1238.                 "%sc%" qc "%%b" | %FIND% "DISPLAY_NAME" >>"%FPRINT%"
  1239.                 "%SC%" qc "%%b" | %FIND% "START_TYPE" >>"%FPRINT%"
  1240.                 echo. >> "%FPRINT%"
  1241.                 )
  1242.         del "%TEMP%\~svclist.txt"
  1243.         echo                                                      ... done.
  1244.         )
  1245. goto :QUIT
  1246. rem **** Additional Feature List ****
  1247. :MORE_OPTIONS
  1248. cls
  1249. echo  ______________________________________________________________________________
  1250. echo.
  1251. echo                 *** Weitere Optionen / More Options Menue ***
  1252. echo                     =====================================
  1253. echo.
  1254. if /I "%SVC_MOD%"=="YES" (
  1255.         echo  [E]...Zeigt eine Liste an, welche Dienste seit der letzten Anwendung
  1256.         echo        von svc2kxp.cmd veraendert wurden.
  1257.         echo.
  1258.         echo        Shows a list with modified services since last use of scv2kxp.cmd
  1259.         echo.
  1260.         )
  1261. echo  [G]...Generiert einen neuen Fingerprint, um Veraenderungen bei
  1262. echo        Diensten zu erfassen
  1263. echo.
  1264. echo        Generates a new fingerprint to correctly detect changes of
  1265. echo        services
  1266. echo.
  1267. echo  [S]...Sichern der aktuellen Dienstekonfiguration.
  1268. echo        Saving current NT service configuration (auto/demand/disabled).
  1269. echo.
  1270. echo  ______________________________________________________________________________
  1271. echo.
  1272. if /I "%SVC_MOD%"=="NO" set /P CHS=       Bitte waehlen Sie/Please choose: [G], [S], [B]ack or [Q]uit?
  1273. if /I "%SVC_MOD%"=="YES" set /P CHS=       Bitte waehlen Sie/Please choose: [E], [G], [S], [B]ack or [Q]uit?
  1274. if /I "%SVC_MOD%"=="YES" if /I "%CHS%"=="E" GOTO :EVALUATE_SERVICES
  1275. if /I "%CHS%"=="G" GOTO :CREATING_NEW_FINGERPRINT
  1276. if /I "%CHS%"=="B" (
  1277.                     CLS
  1278.                     GOTO :START
  1279.                    )
  1280. if /I "%CHS%"=="S" GOTO :SAVE_SVC_SETTINGS
  1281. if /I "%CHS%"=="Q" GOTO :QUIT
  1282. GOTO :MORE_OPTIONS
  1283. :EVALUATE_SERVICES
  1284. cls
  1285. echo  ______________________________________________________________________________
  1286. echo.
  1287. echo                        *** Evaluate Services Menue ***
  1288. echo.
  1289. "%FC%" /N "%FPRINT%" "%USERPROFILE%\ntsvcfg\svc2cmp.sav"
  1290. echo  ______________________________________________________________________________
  1291. echo.
  1292. set /P CHS=       Bitte waehlen Sie/Please choose: [B]ack, [U]pdate or [Q]uit?
  1293. if /I "%CHS%"=="B" GOTO :MORE_OPTIONS
  1294. if /I "%CHS%"=="U" GOTO :CREATING_NEW_FINGERPRINT
  1295. if /I "%CHS%"=="Q" GOTO :QUIT
  1296. GOTO :MORE_OPTIONS
  1297. :SAVE_SVC_SETTINGS
  1298. cls
  1299. echo  ______________________________________________________________________________
  1300. echo.
  1301. echo               *** Manage current services configurations menue ***
  1302. echo                   --------------------------------------------
  1303. echo.
  1304. echo   Soll die aktuelle Dienstekonfiguration gesichert werden?
  1305. echo.
  1306. set /P CHS=  Should the current service configuration saved (y/n)?
  1307. if /I "%CHS%"=="N" GOTO :MORE_OPTIONS
  1308. if /I "%CHS%"=="Y" (
  1309.         echo   Saving current services settings to:
  1310.         echo.
  1311.         echo    - %SVC_SAV%
  1312.         "%regedit%" /e "%SVC_SAV%" HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
  1313.         echo.
  1314.         echo   ... Done!
  1315.         echo  ______________________________________________________________________________
  1316.         echo.
  1317.         echo        Beliebige Taste druecken, um fortzufahren. Hit any key to return.
  1318.         pause>NUL
  1319.         )
  1320. if /I "%CHS%"=="Q" GOTO :QUIT
  1321. goto :MORE_OPTIONS
  1322. pause >NUL
  1323. goto :MORE_OPTIONS
  1324. :CREATING_NEW_FINGERPRINT
  1325. cls
  1326. echo  ______________________________________________________________________________
  1327. echo.
  1328. echo                     *** Creating new fingerprint menue ***
  1329. echo                         ------------------------------
  1330. echo.
  1331. set /P CHS=  Create new fingerprint [Y/N]?
  1332. if /I "%CHS%"=="Y" (
  1333.         if exist "%FPRINT%" del /F /Q "%FPRINT%"
  1334.         echo   Creating new fingerprint which will take a few seconds ...
  1335.         "%sc%" query type= service state= all bufsize= 8192 | %FIND% "SERVICE_NAME" > %TEMP%\~svclist.txt
  1336.         for /F "tokens=1*" %%a in (%TEMP%\~svclist.txt) do (
  1337.                 echo %%b >>"%FPRINT%"
  1338.                 "%sc%" query "%%b" | %FIND% "STATE" >>"%FPRINT%"
  1339.                 "%sc%" qc "%%b" | %FIND% "DISPLAY_NAME" >>"%FPRINT%"
  1340.                 "%SC%" qc "%%b" | %FIND% "START_TYPE" >>"%FPRINT%"
  1341.                 echo. >> "%FPRINT%"
  1342.                 )
  1343.         del "%TEMP%\~svclist.txt"
  1344.         echo                                                           ... done.
  1345.         echo  ______________________________________________________________________________
  1346.         echo.
  1347.         echo                          [Press any key to continue]
  1348.         set CHK_SVC=YES
  1349.         PAUSE >NUL
  1350.         )
  1351. cls
  1352. GOTO :MORE_OPTIONS
  1353. :XPSYSRESTORE
  1354. REM Creating A System Restore Point // Source Code: MS Technet Scriptcenter
  1355.         echo.
  1356.         echo  # Creating System Restore Point [if XP SysRestore is enabled] ...
  1357.         if exist "%srctmp%" del /F /Q "%srctmp%"
  1358.         echo CONST DEVICE_DRIVER_INSTALL = 10 >"%srctmp%"
  1359.         echo CONST BEGIN_SYSTEM_CHANGE = 100 >>"%srctmp%"
  1360.         echo.>>"%srctmp%"
  1361.         echo strComputer = ".">>"%srctmp%"
  1362.         echo Set objWMIService = GetObject("winmgmts:" _ >>"%srctmp%"
  1363.         echo         ^& "{impersonationLevel=impersonate}!\\" ^& strComputer ^& "\root\default")>>"%srctmp%"
  1364.         echo.>>"%srctmp%"
  1365.         echo Set objItem = objWMIService.Get("SystemRestore")>>"%srctmp%"
  1366.         echo errResults = objItem.CreateRestorePoint _ >>"%srctmp%"
  1367.         echo         ("svc2kxp.cmd created restore point", DEVICE_DRIVER_INSTALL, BEGIN_SYSTEM_CHANGE)>>"%srctmp%"
  1368.         "%srctmp%"
  1369.         del /F /Q "%srctmp%"
  1370.         echo.
  1371. goto :XPSYSRESTORE_DONE
  1372. :END
  1373. if "%REBOOT_REQUIRED%"=="yes" (
  1374.         echo.
  1375.         echo  ______________________________________________________
  1376.         echo.
  1377.         echo           *** Zusammenfassung / Result ***
  1378.         echo.
  1379.         if /I %SELECT%=="/all" echo  Es wurden alle gewuenschten Aenderungen durchgefuehrt.
  1380.         if /I %SELECT%=="/std" echo  Einige Dienste blieben unveraendert.
  1381.         if /I %SELECT%=="/relan" echo  Notwendige LAN-Einstellungen wurden aktiviert.
  1382. if /I %DHCP_CHANGES%=="YES" (
  1383.           echo.
  1384.    echo  Wichtiger DHCP Hinweis
  1385.    echo  ======================
  1386.    echo  Ihre Konfiguration deutete an, das kein DHCP benoetigt wird. Falls
  1387.           echo  Sie jedoch einen DSL-Internetzugang besitzen und DHCP irrtuemlich
  1388.    echo  deaktivert wurde, kann es nach einem Neustart zu Problemen mit der
  1389.    echo  Internetverbindung kommen. Starten sie zur Problembehebung den
  1390.    echo  DHCP-Dienst von Hand neu.
  1391.    echo.
  1392. )
  1393. echo.
  1394.         echo  Bitte starten Sie abschliessend Ihren Rechner neu.
  1395.         echo.
  1396.         if /I %SELECT%=="/all" echo  All changes applied successfully.
  1397.         if /I %SELECT%=="/std" echo  Some services stay unchanged.
  1398.         if /I %SELECT%=="/relan" echo  LAN settings reactivated.
  1399. if /I %DHCP_CHANGES%=="YES" (
  1400.           echo.
  1401.    echo  Important DHCP Notice
  1402.    echo  =====================
  1403.    echo  Your configuration indicates that DHCP will no longer be required.
  1404.    echo  But if you are using a DSL internet connection this choice probably
  1405.           echo  might be wrong. If you experiences problems during accessing the
  1406.    echo  internet please re-activate the "DHCP Service" manually.
  1407. echo.
  1408. )
  1409.         echo  Please reboot.
  1410.         echo  ______________________________________________________
  1411.         )
  1412. :QUIT
  1413. echo            ________________________________________________________
  1414. echo.
  1415. echo                 Weitere Informationen: http://www.ntsvcfg.de
  1416. echo            For more informations: http://www.ntsvcfg.de/ntsvcfg_eng
  1417. echo            ________________________________________________________
  1418. echo             [Taste zum Beenden druecken]   [Press any key to quit]
  1419. echo             ------------------------------------------------------
  1420. echo.
  1421. if /I "%1"=="" pause>NUL
  1422. :QUIT_EXT
  1423. endlocal
  1424. if exist "%USERPROFILE%\ntsvcfg\svc2cmp.sav" del /F /Q "%USERPROFILE%\ntsvcfg\svc2cmp.sav"
  1425. echo.
复制代码

搞什么长篇大论?~说明一下
寂寞是黑白的,但黑白不是寂寞,是永恒。BAT 需要的不是可能,而是智慧。

TOP

回复 2楼 的帖子

我哪知道..转载的...

TOP

回复 3楼 的帖子

论坛早就有了。大哥

TOP

我晕哦,如果让启动项不行的话,用不着这么长吧~!

TOP

谁  测试 了
[url=http://taqiao.net]我的空间[/url]

TOP

返回列表