📄 svc2kxp.cmd
字号:
)
goto :QUIT
:SC_DOWNLOAD
echo ______________________________________________________________
echo.
echo Besteht eine aktive Internetverbindung?
echo Are you currently connected to the internet?
echo.
set /P UNDO= Bitte waehlen/Please choose: [y/n]?
if /I "%UNDO%"=="y" goto :SC_DOWNLOAD_OK
goto :END
:SC_DOWNLOAD_OK
if exist "%SYSTEMROOT%\sc.zip" goto :SCE
echo Generating FTP-script ...
if exist "%USERPROFILE%"\script_sc.ls del /F "%USERPROFILE%\script_sc.ls"
echo open 207.46.133.140 >"%USERPROFILE%\script_sc.ls"
echo user anonymous anonymous@aol.com >>"%USERPROFILE%\script_sc.ls"
echo type binary >>"%USERPROFILE%\script_sc.ls"
echo user anonymous anonymous@aol.com >>"%USERPROFILE%\script_sc.ls"
echo type binary >>"%USERPROFILE%\script_sc.ls"
echo get /reskit/win2000/sc.zip "%SYSTEMROOT%\System32\SC.ZIP" >>"%USERPROFILE%\script_sc.ls"
echo quit >>"%USERPROFILE%\script_sc.ls"
echo Downloading SC.EXE ...
ftp -s:"%USERPROFILE%\script_sc.ls"
del /F "%USERPROFILE%\script_sc.ls"
:SCE
if exist "%SYSTEMROOT%\System32\pkunzip.exe" goto :PKE
echo Generating FTP-script ...
if exist "%USERPROFILE%"\script_pk.ls del /F "%USERPROFILE%\script_pk.ls"
echo open ftp.uni-duesseldorf.de >"%USERPROFILE%\script_pk.ls"
echo user anonymous anonymous@aol.com >>"%USERPROFILE%\script_pk.ls"
echo type binary >>"%USERPROFILE%\script_pk.ls"
echo user anonymous anonymous@aol.com >>"%USERPROFILE%\script_pk.ls"
echo type binary >>"%USERPROFILE%\script_pk.ls"
echo get /pub/ie/pkunzip.exe "%SYSTEMROOT%\System32\pkunzip.exe" >>"%USERPROFILE%\script_pk.ls"
echo quit >>"%USERPROFILE%\script_pk.ls"
echo Downloading PKUNZIP.EXE ...
ftp -s:"%USERPROFILE%\script_pk.ls"
del /F "%USERPROFILE%\script_pk.ls"
:PKE
if not exist "%SYSTEMROOT%\System32\sc.zip" (
echo.
echo Download fehlgeschlagen. Bitte laden sie sich die Datei SC.ZIP manuell
echo herunter und kopieren diese nach %SYSTEMROOT%\.
echo.
echo Downloading SC.ZIP failed. Please download it manually an copy it to
echo %SYSTEMROOT%\.
)
if not exist "%SYSTEMROOT%\System32\pkunzip.exe" (
echo.
echo Die Datei PKUNZIP.EXE konnte nicht gefunden werden. Diese wird zum
echo Entpacken des Archivs SC.ZIP benoetigt!
echo.
echo File PKUNZIP.EXE not found. It is needed to decompress the archive SC.EXE.
)
if exist "%SYSTEMROOT%\System32\SC.ZIP" (
if exist "%SYSTEMROOT%\System32\pkunzip.exe" (
"%SYSTEMROOT%\System32\pkunzip.exe" -e "%SYSTEMROOT%\System32\sc.zip" sc.exe
)
)
move /Y sc.exe "%SYSTEMROOT%\System32\"
echo.
echo Skript wird neu gestartet ...
echo Restarting script ...
goto :START
:FIX
echo.
echo -= svc2kxp.cmd taskplaner fix =-
echo.
echo.
echo Druecken Sie "Y", um das Problem mit dem Taskplaner ("falscher Parameter")
echo unter Windows XP zu beheben.
echo.
echo Press "Y", if you want fix issue "scheduler doesn't start under Windows XP
echo after running script v2.0 - v2.1build0".
echo.
set /P UNDO= Fix problem [y/n]?
if /I "%UNDO%"=="y" (
echo REGEDIT4 >"%USERPROFILE%\svc_fix.reg"
echo. >>"%USERPROFILE%\svc_fix.reg"
echo [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Rpc\Internet] >>"%USERPROFILE%\svc_fix.reg"
echo. >>"%USERPROFILE%\svc_fix.reg"
echo. >>"%USERPROFILE%\svc_fix.reg"
"%regedit%" /s "%USERPROFILE%\svc_fix.reg"
del /F /Q "%USERPROFILE%\svc_fix.reg"
echo ______________________________________
echo OK. Bitte starten Sie den Rechner neu und kontrollieren Sie erneut,
echo ob hierdurch Ports geoeffnet wurden.
echo.
echo Done. Please reboot and check again for open ports ...!
)
rem Creating fingerprint of current service settings...
if exist "%FPRINT%" del /F /Q "%FPRINT%"
goto quit
if /I %USE_FPRINT%==YES (
echo.
echo Creating fingerprint which will take a few seconds ...
"%sc%" query type= service state= all bufsize= 8192 | %FIND% "SERVICE_NAME" > %TEMP%\~svclist.txt
for /F "tokens=1*" %%a in (%TEMP%\~svclist.txt) do (
echo %%b >>"%FPRINT%"
"%sc%" query "%%b" | %FIND% "STATE" >>"%FPRINT%"
"%sc%" qc "%%b" | %FIND% "DISPLAY_NAME" >>"%FPRINT%"
"%SC%" qc "%%b" | %FIND% "START_TYPE" >>"%FPRINT%"
echo. >> "%FPRINT%"
)
del "%TEMP%\~svclist.txt"
echo ... done.
)
goto :QUIT
rem **** Additional Feature List ****
:MORE_OPTIONS
cls
echo ______________________________________________________________________________
echo.
echo *** Weitere Optionen / More Options Menue ***
echo =====================================
echo.
if /I "%SVC_MOD%"=="YES" (
echo [E]...Zeigt eine Liste an, welche Dienste seit der letzten Anwendung
echo von svc2kxp.cmd veraendert wurden.
echo.
echo Shows a list with modified services since last use of scv2kxp.cmd
echo.
)
echo [G]...Generiert einen neuen Fingerprint, um Veraenderungen bei
echo Diensten zu erfassen
echo.
echo Generates a new fingerprint to correctly detect changes of
echo services
echo.
echo [S]...Sichern der aktuellen Dienstekonfiguration.
echo Saving current NT service configuration (auto/demand/disabled).
echo.
echo ______________________________________________________________________________
echo.
if /I "%SVC_MOD%"=="NO" set /P CHS= Bitte waehlen Sie/Please choose: [G], [S], [B]ack or [Q]uit?
if /I "%SVC_MOD%"=="YES" set /P CHS= Bitte waehlen Sie/Please choose: [E], [G], [S], [B]ack or [Q]uit?
if /I "%SVC_MOD%"=="YES" if /I "%CHS%"=="E" GOTO :EVALUATE_SERVICES
if /I "%CHS%"=="G" GOTO :CREATING_NEW_FINGERPRINT
if /I "%CHS%"=="B" (
CLS
GOTO :START
)
if /I "%CHS%"=="S" GOTO :SAVE_SVC_SETTINGS
if /I "%CHS%"=="Q" GOTO :QUIT
GOTO :MORE_OPTIONS
:EVALUATE_SERVICES
cls
echo ______________________________________________________________________________
echo.
echo *** Evaluate Services Menue ***
echo.
"%FC%" /N "%FPRINT%" "%USERPROFILE%\ntsvcfg\svc2cmp.sav"
echo ______________________________________________________________________________
echo.
set /P CHS= Bitte waehlen Sie/Please choose: [B]ack, [U]pdate or [Q]uit?
if /I "%CHS%"=="B" GOTO :MORE_OPTIONS
if /I "%CHS%"=="U" GOTO :CREATING_NEW_FINGERPRINT
if /I "%CHS%"=="Q" GOTO :QUIT
GOTO :MORE_OPTIONS
:SAVE_SVC_SETTINGS
cls
echo ______________________________________________________________________________
echo.
echo *** Manage current services configurations menue ***
echo --------------------------------------------
echo.
echo Soll die aktuelle Dienstekonfiguration gesichert werden?
echo.
set /P CHS= Should the current service configuration saved (y/n)?
if /I "%CHS%"=="N" GOTO :MORE_OPTIONS
if /I "%CHS%"=="Y" (
echo Saving current services settings to:
echo.
echo - %SVC_SAV%
"%regedit%" /e "%SVC_SAV%" HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
echo.
echo ... Done!
echo ______________________________________________________________________________
echo.
echo Beliebige Taste druecken, um fortzufahren. Hit any key to return.
pause>NUL
)
if /I "%CHS%"=="Q" GOTO :QUIT
goto :MORE_OPTIONS
pause >NUL
goto :MORE_OPTIONS
:CREATING_NEW_FINGERPRINT
cls
echo ______________________________________________________________________________
echo.
echo *** Creating new fingerprint menue ***
echo ------------------------------
echo.
set /P CHS= Create new fingerprint [Y/N]?
if /I "%CHS%"=="Y" (
if exist "%FPRINT%" del /F /Q "%FPRINT%"
echo Creating new fingerprint which will take a few seconds ...
"%sc%" query type= service state= all bufsize= 8192 | %FIND% "SERVICE_NAME" > %TEMP%\~svclist.txt
for /F "tokens=1*" %%a in (%TEMP%\~svclist.txt) do (
echo %%b >>"%FPRINT%"
"%sc%" query "%%b" | %FIND% "STATE" >>"%FPRINT%"
"%sc%" qc "%%b" | %FIND% "DISPLAY_NAME" >>"%FPRINT%"
"%SC%" qc "%%b" | %FIND% "START_TYPE" >>"%FPRINT%"
echo. >> "%FPRINT%"
)
del "%TEMP%\~svclist.txt"
echo ... done.
echo ______________________________________________________________________________
echo.
echo [Press any key to continue]
set CHK_SVC=YES
PAUSE >NUL
)
cls
GOTO :MORE_OPTIONS
:XPSYSRESTORE
REM Creating A System Restore Point // Source Code: MS Technet Scriptcenter
echo.
echo # Creating System Restore Point [if XP SysRestore is enabled] ...
if exist "%srctmp%" del /F /Q "%srctmp%"
echo CONST DEVICE_DRIVER_INSTALL = 10 >"%srctmp%"
echo CONST BEGIN_SYSTEM_CHANGE = 100 >>"%srctmp%"
echo.>>"%srctmp%"
echo strComputer = ".">>"%srctmp%"
echo Set objWMIService = GetObject("winmgmts:" _ >>"%srctmp%"
echo ^& "{impersonationLevel=impersonate}!\\" ^& strComputer ^& "\root\default")>>"%srctmp%"
echo.>>"%srctmp%"
echo Set objItem = objWMIService.Get("SystemRestore")>>"%srctmp%"
echo errResults = objItem.CreateRestorePoint _ >>"%srctmp%"
echo ("svc2kxp.cmd created restore point", DEVICE_DRIVER_INSTALL, BEGIN_SYSTEM_CHANGE)>>"%srctmp%"
"%srctmp%"
del /F /Q "%srctmp%"
echo.
goto :XPSYSRESTORE_DONE
:END
if "%REBOOT_REQUIRED%"=="yes" (
echo.
echo ______________________________________________________
echo.
echo *** Zusammenfassung / Result ***
echo.
if /I %SELECT%=="/all" echo Es wurden alle gewuenschten Aenderungen durchgefuehrt.
if /I %SELECT%=="/std" echo Einige Dienste blieben unveraendert.
if /I %SELECT%=="/relan" echo Notwendige LAN-Einstellungen wurden aktiviert.
if /I %DHCP_CHANGES%=="YES" (
echo.
echo Wichtiger DHCP Hinweis
echo ======================
echo Ihre Konfiguration deutete an, das kein DHCP benoetigt wird. Falls
echo Sie jedoch einen DSL-Internetzugang besitzen und DHCP irrtuemlich
echo deaktivert wurde, kann es nach einem Neustart zu Problemen mit der
echo Internetverbindung kommen. Starten sie zur Problembehebung den
echo DHCP-Dienst von Hand neu.
echo.
)
echo.
echo Bitte starten Sie abschliessend Ihren Rechner neu.
echo.
if /I %SELECT%=="/all" echo All changes applied successfully.
if /I %SELECT%=="/std" echo Some services stay unchanged.
if /I %SELECT%=="/relan" echo LAN settings reactivated.
if /I %DHCP_CHANGES%=="YES" (
echo.
echo Important DHCP Notice
echo =====================
echo Your configuration indicates that DHCP will no longer be required.
echo But if you are using a DSL internet connection this choice probably
echo might be wrong. If you experiences problems during accessing the
echo internet please re-activate the "DHCP Service" manually.
echo.
)
echo Please reboot.
echo ______________________________________________________
)
:QUIT
echo ________________________________________________________
echo.
echo Weitere Informationen: http://www.ntsvcfg.de
echo For more informations: http://www.ntsvcfg.de/ntsvcfg_eng
echo ________________________________________________________
echo [Taste zum Beenden druecken] [Press any key to quit]
echo ------------------------------------------------------
echo.
if /I "%1"=="" pause>NUL
:QUIT_EXT
endlocal
if exist "%USERPROFILE%\ntsvcfg\svc2cmp.sav" del /F /Q "%USERPROFILE%\ntsvcfg\svc2cmp.sav"
echo.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -