经过在虚拟机测试,当只有一个系统盘以及一个光驱盘符的时候,运行该批处理会出现一次“系统找不到指定的路径。”错误提示。当系统存在C、D两个固定驱动器的时候却不会出现上述错误提示。请问有谁知道我的批处理代码错在哪里吗?复制代码
- @ECHO OFF
- TITLE RunOnce
- MODE CON: COLS=50 LINES=12
- ECHO=RunOnce.CMD 操作开始,请耐心等待新的操作提示。
- for /f "skip=2 tokens=2 delims==" %%a in ('wmic path Win32_SystemEnclosure get ChassisTypes /value') do set a=%%a
- set b=0
- if "%a%"=="{3}" set b=2
- REG ADD "HKEY_USERS\.DEFAULT\Control Panel\Keyboard" /v "InitialKeyboardIndicators" /d "%b%" /f >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Control Panel\Keyboard" /v "InitialKeyboardIndicators" /d "%b%" /f >NUL 2>NUL
- if "%b%"=="2" (
- echo>%temp%\NumLock.vbs On Error Resume Next
- echo>>%temp%\NumLock.vbs set WshShell=CreateObject("WScript.shell"^)
- echo>>%temp%\NumLock.vbs WshShell.SendKeys"{NUMLOCK}"
- echo>>%temp%\NumLock.vbs CreateObject("Scripting.FileSystemObject"^).DeleteFile WSH.ScriptFullName, True
- START "" "%temp%\NumLock.vbs" >NUL 2>NUL
- )
- net accounts /maxpwage:unlimited >nul 2>nul
- if exist "%SYSTEMROOT%\SYSTEM32\QQPhotoDrawEx.dll" regsvr32 /s "%SYSTEMROOT%\SYSTEM32\QQPhotoDrawEx.dll" >NUL 2>NUL
- if exist "%SYSTEMROOT%\SYSTEM32\QQQunPhotoDrawEx.dll" regsvr32 /s "%SYSTEMROOT%\SYSTEM32\QQQunPhotoDrawEx.dll" >NUL 2>NUL
- if exist "%SYSTEMROOT%\SYSTEM32\QQPhotoDrawProxy.dll" regsvr32 /s "%SYSTEMROOT%\SYSTEM32\QQPhotoDrawProxy.dll" >NUL 2>NUL
- if exist "%SYSTEMROOT%\SYSTEM32\npQQPhotoDrawEx.dll" regsvr32 /s "%SYSTEMROOT%\SYSTEM32\npQQPhotoDrawEx.dll" >NUL 2>NUL
- if exist "%SYSTEMROOT%\SYSTEM32\TXFTNActiveX.dll" regsvr32 /s "%SYSTEMROOT%\SYSTEM32\TXFTNActiveX.dll" >NUL 2>NUL
- SC config WSCSVC start= AUTO >nul 2>nul
- SC config WebClient start= DISABLED >nul 2>nul
- SC config Stisvc start= AUTO >nul 2>nul
- SC config SRSERVICE start= DISABLED >nul 2>nul
- SC config seclogon start= DISABLED >nul 2>nul
- SC config RemoteRegistry start= DISABLED >nul 2>nul
- SC config ImapiService start= AUTO >nul 2>nul
- SC config HELPSVC start= DISABLED >nul 2>nul
- SC config ERSVC start= DISABLED >nul 2>nul
- SC config BITS start= AUTO >nul 2>nul
- if exist %systemroot%\system32\ipseccmd.exe ipseccmd -w REG -p "HFUT_SECU" -r "Block TCP/135" -f *+0:135:TCP -n BLOCK -x >nul 2>nul
- if exist %systemroot%\system32\ipseccmd.exe ipseccmd -w REG -p "HFUT_SECU" -r "Block UDP/135" -f *+0:135:UDP -n BLOCK -x >nul 2>nul
- RunDll32 setupapi.dll,InstallHinfSection DefaultInstall 128 WINDOWSXP-KB2779562-X86-CHS.INF >NUL 2>NUL
- DEL/Q/F %systemroot%\INF\WINDOWSXP-KB2779562-X86-CHS.INF
- DEL/Q/F %systemroot%\INF\WINDOWSXP-KB2779562-X86-CHS.PNF
- RunDLL32 shell32.dll,Control_RunDLL %SystemRoot%\system32\TIMEDATE.cpl,,/Z China Standard Time
- %systemroot%\SYSTEM32\MsnMsgs.MSI /q
- DEL/Q/F %systemroot%\SYSTEM32\MsnMsgs.MSI
- sc stop AlipaySecSvc >nul 2>nul
- sc config AlipaySecSvc start= DEMAND >nul 2>nul
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Compression" /V "DefFolder" /D "" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Extraction" /V "DefFolder" /D "" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Extraction" /V "AppendName" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Extraction" /V "RemoveRedundantFolder" /T "REG_DWORD" /D "0" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Extraction" /V "UseExclNames" /T "REG_DWORD" /D "0" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\General" /V "Priority" /T "REG_DWORD" /D "0" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\General" /V "SMP" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\General" /V "History" /T "REG_DWORD" /D "0" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\General" /V "DlgHistory" /T "REG_DWORD" /D "0" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\General" /V "WizardMode" /T "REG_DWORD" /D "0" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\General" /V "ShowComment" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\General" /V "Log" /T "REG_DWORD" /D "0" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\General" /V "ReuseWindow" /T "REG_DWORD" /D "0" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\General" /V "Sound" /T "REG_DWORD" /D "0" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\General" /V "RestoreFolder" /T "REG_DWORD" /D "0" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\General" /V "WipeTemp" /T "REG_DWORD" /D "0" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\General\Toolbar" /V "ViewMain" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\General\Toolbar" /V "ViewSmall" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\General\Toolbar" /V "LargeButtons" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\General\Toolbar" /V "ButtonsText" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Interface" /V "SystemProgressBar" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Interface" /V "TaskbarProgressBar" /T "REG_DWORD" /D "0" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\FileList" /V "ShowSeconds" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Paths" /V "TempRemovableOnly" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Paths" /V "StartFolder" /D "" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Viewer" /V "Type" /T "REG_DWORD" /D "2" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Viewer" /V "DosCharSet" /T "REG_DWORD" /D "0" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Viewer" /V "ReuseWindow" /T "REG_DWORD" /D "0" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Viewer" /V "Wrap" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Viewer" /V "ExternalViewer" /D "" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Setup" /V "CascadedMenu" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Setup\.RAR" /V "Set" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Setup\.TAR" /V "Set" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Setup\.ZIP" /V "Set" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Setup\.GZip" /V "Set" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Setup\.CAB" /V "Set" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Setup\.UUE" /V "Set" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Setup\.ARJ" /V "Set" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Setup\.BZ2" /V "Set" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Setup\.LZH" /V "Set" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Setup\.JAR" /V "Set" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Setup\.ACE" /V "Set" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Setup\.ISO" /V "Set" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Setup\.7-Zip" /V "Set" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\Setup\.Z" /V "Set" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\WinRAR\VirusScan" /V "Prompt" /T "REG_DWORD" /D "1" /F >NUL 2>NUL
- REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.zip" /VE /D "WinRAR.ZIP" /F >NUL 2>NUL
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\4080110900063D11C8EF10054038389C\Patches\8A1D993794709E340B8060D603DF29F8" /v "MSI3" /t "REG_DWORD" /d "1" /f >nul 2>nul
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\4080110900063D11C8EF10054038389C\Patches\8A1D993794709E340B8060D603DF29F8" /v "State" /t "REG_DWORD" /d "1" /f >nul 2>nul
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\4080110900063D11C8EF10054038389C\Patches\8A1D993794709E340B8060D603DF29F8" /v "Uninstallable" /t "REG_DWORD" /d "0" /f >nul 2>nul
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\4080110900063D11C8EF10054038389C\Patches\8A1D993794709E340B8060D603DF29F8" /v "LUAEnabled" /t "REG_DWORD" /d "0" /f >nul 2>nul
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\4080110900063D11C8EF10054038389C\Patches\8A1D993794709E340B8060D603DF29F8" /v "PatchType" /t "REG_DWORD" /d "0" /f >nul 2>nul
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\4080110900063D11C8EF10054038389C\Patches\8A1D993794709E340B8060D603DF29F8" /v "Installed" /d "%date:~0,4%%date:~5,2%%date:~8,2%" /f >nul 2>nul
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\4080110900063D11C8EF10054038389C\Patches\8A1D993794709E340B8060D603DF29F8" /v "DisplayName" /d "Update for Outlook 2003 Junk E-mail Filter (KB2760754): OUTLFLTR" /f >nul 2>nul
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\4080110900063D11C8EF10054038389C\Patches\8A1D993794709E340B8060D603DF29F8" /v "MoreInfoURL" /d "http://support.microsoft.com/kb/2760754" >nul 2>nul
- REG DELETE "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Default HTML Editor\shell\edit\command" /F >NUL 2>NUL
- REG DELETE "HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Default HTML Editor\shell\edit\command" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Default HTML Editor" /V "Description" /D "记事本" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Default HTML Editor\shell\edit\command" /VE /T "REG_EXPAND_SZ" /D "%%SystemRoot%%\system32\NOTEPAD.EXE %%1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Shared\HTML\Default Editor\shell\edit\command" /VE /T "REG_EXPAND_SZ" /D "%%SystemRoot%%\system32\NOTEPAD.EXE %%1" /F >NUL 2>NUL
- REG ADD "HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Default HTML Editor" /V "Description" /D "记事本" /F >NUL 2>NUL
- REG ADD "HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Default HTML Editor\shell\edit\command" /VE /T "REG_EXPAND_SZ" /D "%%SystemRoot%%\system32\NOTEPAD.EXE %%1" /F >NUL 2>NUL
- REG ADD "HKEY_LOCAL_MACHINE\Software\Microsoft\Shared\HTML\Default Editor\shell\edit\command" /VE /T "REG_EXPAND_SZ" /D "%%SystemRoot%%\system32\NOTEPAD.EXE %%1" /F >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_MAXCONNECTIONSPERSERVER" /v "iexplore.exe" /t "REG_DWORD" /d "64" /f >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\MAXCONNECTIONSPER1_0SERVER" /v "iexplore.exe" /t "REG_DWORD" /d "64" /f >NUL 2>NUL
- REG ADD "HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_MAXCONNECTIONSPERSERVER" /v "iexplore.exe" /t "REG_DWORD" /d "64" /f >NUL 2>NUL
- REG ADD "HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main\FeatureControl\MAXCONNECTIONSPER1_0SERVER" /v "iexplore.exe" /t "REG_DWORD" /d "64" /f >NUL 2>NUL
- IF EXIST "%systemroot%\Web\Wallpaper\Wallpaper*.jpg" DEL/F/Q "%systemroot%\Web\Wallpaper\Wallpaper*.jpg" >NUL 2>NUL
- DEL/F/Q/S/A "%SYSTEMDRIVE%\Documents and Settings\DD_*.TXT" >nul 2>nul
- DEL/F/Q/S/A "%SYSTEMDRIVE%\Documents and Settings\AUCHECK_PARSER.TXT" >nul 2>nul
- DEL/F/Q/S/A "%SYSTEMDRIVE%\Documents and Settings\DD_*.TXT" >nul 2>nul
- DEL/F/Q/S/A "%SYSTEMDRIVE%\Documents and Settings\AUCHECK_PARSER.TXT" >nul 2>nul
- DEL/F/Q/S/A "%SYSTEMDRIVE%\Documents and Settings\DD_*.TXT" >nul 2>nul
- DEL/F/Q/S/A "%SYSTEMDRIVE%\Documents and Settings\AUCHECK_PARSER.TXT" >nul 2>nul
- IF EXIST "%SYSTEMDRIVE%\FTNSTAT.*" DEL/F/Q "%SYSTEMDRIVE%\FTNSTAT.*" >NUL 2>NUL
- if exist "%systemroot%\FONTMP\fontinst.exe" "%systemroot%\FONTMP\fontinst.exe"
- IF EXIST "%systemroot%\FONTMP\" RD/Q/S "%systemroot%\FONTMP" >nul 2>nul
- WMPNetwk.exe
- powercfg.exe /h off >NUL 2>NUL
- chkntfs /t:0 >NUL 2>NUL
- IF EXIST %SYSTEMROOT%\SYSTEM32\OEMINFO.INI ATTRIB %SYSTEMROOT%\SYSTEM32\OEMINFO.INI +A +H +R +S >NUL 2>NUL
- IF EXIST %SYSTEMROOT%\SYSTEM32\OEMLOGO.BMP ATTRIB %SYSTEMROOT%\SYSTEM32\OEMLOGO.BMP +A +H +R +S >NUL 2>NUL
- REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "AutoAdminLogon" /d "0" /f >nul 2>nul
- REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "DefaultPassword" /f >nul 2>nul
- REG DELETE "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchScopes\{502244CB-1653-4B8D-834A-4616388689CE}" /f >NUL 2>NUL
- DEL/F/Q/S/A "%SYSTEMDRIVE%\Documents and Settings\邮件接收者.MAPIMail" >NUL 2>NUL
- DEL/F/Q/S/A "%SYSTEMDRIVE%\Documents and Settings\压缩(zipped)文件夹.ZFSendToTarget" >NUL 2>NUL
- IF EXIST "%ALLUSERSPROFILE%\「开始」菜单\设定程序访问和默认值.*" DEL /F /Q /A "%ALLUSERSPROFILE%\「开始」菜单\设定程序访问和默认值.*" >NUL 2>NUL
- IF EXIST "%ALLUSERSPROFILE%\「开始」菜单\Windows Update.*" IF EXIST "%ALLUSERSPROFILE%\「开始」菜单\Microsoft Update.*" DEL /F /Q /A "%ALLUSERSPROFILE%\「开始」菜单\Windows Update.*" >NUL 2>NUL
- IF EXIST "%USERPROFILE%\「开始」菜单\Microsoft Update.lnk" IF EXIST "%ALLUSERSPROFILE%\「开始」菜单\Microsoft Update.lnk" DEL /F /Q /A "%USERPROFILE%\「开始」菜单\Microsoft Update.lnk" >NUL 2>NUL
- IF EXIST "%SYSTEMDRIVE%\Documents and Settings\IS*.TMP" (
- FOR /F "DELIMS=" %%I IN ('DIR/B/S/AD "%SYSTEMDRIVE%\Documents and Settings\IS*.TMP"') DO (
- IF EXIST "%%I\" RD/Q/S "%%I"
- )
- ) >NUL 2>NUL
- IF EXIST "%SYSTEMDRIVE%\PerfLog\" RD/Q/S "%SYSTEMDRIVE%\PerfLog" >NUL 2>NUL
- DEL/F/S/Q/A %SYSTEMROOT%\setuperr.log >NUL 2>NUL
- DEL/F/S/Q/A %SYSTEMROOT%\WGAErrLog.log >NUL 2>NUL
- REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "IMJPMIG8.1" /f >NUL 2>NUL
- REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "PHIME2002ASync" /f >NUL 2>NUL
- REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "PHIME2002A" /f >NUL 2>NUL
- REG DELETE "HKEY_CURRENT_USER\Keyboard Layout\Preload" /va /f >NUL 2>NUL
- REG DELETE "HKEY_USERS\.DEFAULT\Keyboard Layout\Preload" /va /f >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Keyboard Layout\Preload" /v "1" /d "00000804" /f >NUL 2>NUL
- REG ADD "HKEY_USERS\.DEFAULT\Keyboard Layout\Preload" /v "1" /d "00000804" /f >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Keyboard Layout\Preload" /v "2" /d "E0200804" /f >NUL 2>NUL
- REG ADD "HKEY_USERS\.DEFAULT\Keyboard Layout\Preload" /v "2" /d "E0200804" /f >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Keyboard Layout\Preload" /v "3" /d "E0210804" /f >NUL 2>NUL
- REG ADD "HKEY_USERS\.DEFAULT\Keyboard Layout\Preload" /v "3" /d "E0210804" /f >NUL 2>NUL
- REG ADD "HKEY_CURRENT_USER\Keyboard Layout\Preload" /v "4" /d "E00E0804" /f >NUL 2>NUL
- REG ADD "HKEY_USERS\.DEFAULT\Keyboard Layout\Preload" /v "4" /d "E00E0804" /f >NUL 2>NUL
- reg export HKEY_CLASSES_ROOT\HCP %SYSTEMROOT%\hcp_backup.reg >NUL 2>NUL
- reg delete HKEY_CLASSES_ROOT\HCP /f >NUL 2>NUL
- FOR %%I IN (C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO (
- net stop Browser >NUL 2>NUL
- net stop Server >NUL 2>NUL
- reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters" /v "AutoShareWks" /t "REG_DWORD" /d "0" /f >NUL 2>NUL
- net share admin$ /delete >NUL 2>NUL
- reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa" /v "restrictanonymous" /t "REG_DWORD" /d "1" /f >NUL 2>NUL
- net share ipc$ /delete >NUL 2>NUL
- reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters" /v "AutoShareServer" /t "REG_DWORD" /d "0" /f >NUL 2>NUL
- net share %%I$ /delete >NUL 2>NUL
- net start Server >NUL 2>NUL
- net start Browser >NUL 2>NUL
- )
- IF EXIST "%SYSTEMROOT%\DRVLOAD.EXE" (
- ECHO>"%ALLUSERSPROFILE%\「开始」菜单\程序\启动\CLDRV.CMD" @ECHO OFF
- ECHO>>"%ALLUSERSPROFILE%\「开始」菜单\程序\启动\CLDRV.CMD" IF EXIST %%SYSTEMROOT%%\SYSTEM32\cwnd.exe cwnd /HIDE @
- ECHO>>"%ALLUSERSPROFILE%\「开始」菜单\程序\启动\CLDRV.CMD" TITLE 驱动包清理程序
- ECHO>>"%ALLUSERSPROFILE%\「开始」菜单\程序\启动\CLDRV.CMD" IF EXIST %%SYSTEMROOT%%\*DRVLOAD* DEL/F/Q/S/A %%SYSTEMROOT%%\*DRVLOAD* ^>NUL 2^>NUL
- ECHO>>"%ALLUSERSPROFILE%\「开始」菜单\程序\启动\CLDRV.CMD" IF EXIST "%%SYSTEMDRIVE%%\Sysprep\" RD/Q/S "%%SYSTEMDRIVE%%\Sysprep" ^>NUL 2^>NUL
- ECHO>>"%ALLUSERSPROFILE%\「开始」菜单\程序\启动\CLDRV.CMD" DEL %%0
- )
- REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Easy DriverPacks" /F >NUL 2>NUL
- REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\WanDrv" /F >NUL 2>NUL
- DEL/F/Q/S/A %SYSTEMROOT%\*.ed5log >NUL 2>NUL
- FOR /F "DELIMS=" %%I IN ('DIR/A/B/S "D:\Personal\「开始」菜单\*Internet Explorer*"') DO IF EXIST "%%I" ATTRIB /D /S "%%I" +R +S >NUL 2>NUL
- FOR /F "DELIMS=" %%I IN ('DIR/A/B/S "%systemdrive%\Documents and Settings\*Internet Explorer*"') DO IF EXIST "%%I" ATTRIB /D /S "%%I" +R +S >NUL 2>NUL
- REG DELETE "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\Components\0" /F >NUL 2>NUL
- IF EXIST "%userprofile%\Favorites\Microsoft 网站\" (
- RD/Q/S "%userprofile%\Favorites\Microsoft 网站" >nul 2>nul
- REM.>"%userprofile%\Favorites\Microsoft 网站"
- ATTRIB /D /S "%userprofile%\Favorites\Microsoft 网站" +A +H +R +S >nul 2>nul
- ) ELSE (
- DEL/F/Q/A "%userprofile%\Favorites\Microsoft 网站" >nul 2>nul
- REM.>"%userprofile%\Favorites\Microsoft 网站"
- ATTRIB /D /S "%userprofile%\Favorites\Microsoft 网站" +A +H +R +S >nul 2>nul
- )
- IF EXIST "%userprofile%\Favorites\链接\" (
- RD/Q/S "%userprofile%\Favorites\链接" >nul 2>nul
- REM.>"%userprofile%\Favorites\链接"
- ATTRIB /D /S "%userprofile%\Favorites\链接" +A +H +R +S >nul 2>nul
- ) ELSE (
- DEL/F/Q/A "%userprofile%\Favorites\链接" >nul 2>nul
- REM.>"%userprofile%\Favorites\链接"
- ATTRIB /D /S "%userprofile%\Favorites\链接" +A +H +R +S >nul 2>nul
- )
- IF EXIST "%userprofile%\Favorites\收藏夹栏\" (
- RD/Q/S "%userprofile%\Favorites\收藏夹栏" >nul 2>nul
- REM.>"%userprofile%\Favorites\收藏夹栏"
- ATTRIB /D /S "%userprofile%\Favorites\收藏夹栏" +A +H +R +S >nul 2>nul
- ) ELSE (
- DEL/F/Q/A "%userprofile%\Favorites\收藏夹栏" >nul 2>nul
- REM.>"%userprofile%\Favorites\收藏夹栏"
- ATTRIB /D /S "%userprofile%\Favorites\收藏夹栏" +A +H +R +S >nul 2>nul
- )
- IF EXIST %SYSTEMROOT%\EXHOTFIX.CMD REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce" /v "OFFICE2007补充补丁包" /d "%systemroot%\EXHOTFIX.CMD" >NUL 2>NUL
- IF EXIST "%SYSTEMROOT%\*KB2757638*.EXE" FOR /F "DELIMS=" %%I IN ('DIR/B/O "%SYSTEMROOT%\*KB2757638*.EXE"') DO IF EXIST "%SYSTEMDRIVE%\SOFTWARES\*THUNDER*.EXE" MOVE /Y "%SYSTEMROOT%\%%I" %SYSTEMDRIVE%\SOFTWARES\
- IF EXIST "%SYSTEMROOT%\*KB951830*.EXE" FOR /F "DELIMS=" %%I IN ('DIR/B/O "%SYSTEMROOT%\*KB951830*.EXE"') DO (
- FOR /F %%i IN ('ipconfig /all ^| find /c /i "Ethernet Adapter"') DO IF "%%i" GEQ "3" "%SYSTEMROOT%\%%I" /q /n /z >NUL 2>NUL
- DEL/F/Q/A "%SYSTEMROOT%\%%I" >NUL 2>NUL
- )
- IF EXIST "%SYSTEMROOT%\WINDOWS*KB*.EXE" FOR /F "DELIMS=" %%I IN ('DIR/B/O:D "%SYSTEMROOT%\WINDOWS*KB*.EXE"') DO (
- "%SYSTEMROOT%\%%I" /q /n /z >NUL 2>NUL
- )
- ping 127.0.0.1 -n 3 >NUL 2>NUL
- DEL/F/Q/A "%SYSTEMROOT%\WINDOWS*KB*.EXE" >NUL 2>NUL
- FOR %%I IN (C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO (
- IF EXIST "%%I:\HotFix\WINDOWS*KB*.EXE" FOR /F "DELIMS=" %%W IN ('DIR/B/O:D "%%I:\HotFix\WINDOWS*KB*.EXE"') DO (
- "%%I:\HotFix\%%W" /q /n /z >NUL 2>NUL
- )
- )
- FOR %%I IN (C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO (
- IF EXIST "%%I:\HotFix\OFFICE*KB*.EXE" FOR /F "DELIMS=" %%O IN ('DIR/B/O:D "%%I:\HotFix\OFFICE*KB*.EXE"') DO (
- "%%I:\HotFix\%%O" /Q:A /R:N >NUL 2>NUL
- )
- )
- REG DELETE "HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\RunOnce" /V "GUISETUP" /F >NUL 2>NUL
- REG DELETE "HKEY_USERS\S-1-5-18\Software\Microsoft\Windows\CurrentVersion\RunOnce" /V "GUISETUP" /F >NUL 2>NUL
- REG DELETE "HKEY_USERS\S-1-5-19\Software\Microsoft\Windows\CurrentVersion\RunOnce" /V "GUISETUP" /F >NUL 2>NUL
- REG DELETE "HKEY_USERS\S-1-5-20\Software\Microsoft\Windows\CurrentVersion\RunOnce" /V "GUISETUP" /F >NUL 2>NUL
- IF EXIST %SYSTEMDRIVE%\*.LOG DEL/F/Q/A %SYSTEMDRIVE%\*.LOG >NUL 2>NUL
- IF EXIST "%TEMP%\Office2003.log" DEL/F/Q/A "%TEMP%\Office2003.log" >NUL 2>NUL
- DEL/F/Q/S/A "%systemdrive%\Documents and Settings\*.idx" >NUL 2>NUL
- DEL/F/Q/S/A "%systemdrive%\Documents and Settings\*.tpt" >NUL 2>NUL
- DEL/F/Q/A "%SYSTEMROOT%\Tasks\*.job" >NUL 2>NUL
- IF EXIST "%ProgramFiles%\PcTools\SystemTools\AutoDisplay.exe" START/WAIT "" "%ProgramFiles%\PcTools\SystemTools\AutoDisplay.exe" /wait -10
- FOR /F %%I IN ('ipconfig /all ^| find /c /i "Ethernet Adapter"') DO (
- IF NOT "%%I"=="0" IF EXIST "%ProgramFiles%\PcTools\SystemTools\NetCfg.exe" START/WAIT "" "%ProgramFiles%\PcTools\SystemTools\NetCfg.exe"
- )
- IF NOT EXIST "%SYSTEMDRIVE%\SOFTWARES\软件管理器.CMD" msg %username% /time:1 "RunOnce.CMD 操作结束,部分优化项目重启后生效。"
- IF EXIST "%SYSTEMDRIVE%\SOFTWARES\" IF NOT EXIST %SYSTEMDRIVE%\SOFTWARES\*.EXE IF NOT EXIST %SYSTEMDRIVE%\SOFTWARES\*.MSI IF NOT EXIST %SYSTEMDRIVE%\SOFTWARES\*.BAT IF NOT EXIST %SYSTEMDRIVE%\SOFTWARES\*.CMD RD/Q/S "%SYSTEMDRIVE%\SOFTWARES" >NUL 2>NUL
- IF EXIST "%SYSTEMDRIVE%\SOFTWARES\软件管理器.CMD" START "" CMD /C "%SYSTEMDRIVE%\SOFTWARES\软件管理器.CMD"
- wmic nteventlog get filename
- wmic nteventlog where filename="AppEvent" call cleareventlog
- wmic nteventlog where filename="SecEvent" call cleareventlog
- wmic nteventlog where filename="SysEvent" call cleareventlog
- DEL %0
我本来以为有 IF EXIST "%%I"就不会出错,结果发现原来没有“D:\”也会出错。复制代码
- FOR /F "DELIMS=" %%I IN ('DIR/A/B/S "D:\Personal\「开始」菜单\*Internet Explorer*"') DO IF EXIST "%%I" ATTRIB /D /S "%%I" +R +S >NUL 2>NUL
问题解决了复制代码
- IF EXIST "D:\Personal\" FOR /F "DELIMS=" %%I IN ('DIR/A/B/S "D:\Personal\「开始」菜单\*Internet Explorer*"') DO IF EXIST "%%I" ATTRIB /D /S "%%I" +R +S >NUL 2>NUL
欢迎光临 批处理之家 (http://www.bathome.net/) | Powered by Discuz! 7.2 |