Windows 10 X64 测试通过
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
@echo off for /f "tokens=2,*" %%i in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "My Video"') do (set Video=%%j) for /f "tokens=2,*" %%i in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "My Pictures"') do (set Picture=%%j) for /f "tokens=2,*" %%i in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Personal"') do (set Document=%%j) for /f "tokens=2,*" %%i in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "{374DE290-123F-4565-9164-39C4925E467B}"') do (set Download=%%j) for /f "tokens=2,*" %%i in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "My Music"') do (set Music=%%j) for /f "tokens=2,*" %%i in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Desktop"') do (set Desktop=%%j) rem 获取六个文件夹位置 attrib %Video:~10%\desktop.ini -s -h attrib %Picture:~10%\desktop.ini -s -h attrib %Document%\desktop.ini -s -h attrib %Download%\desktop.ini -s -h attrib %Music:~10%\desktop.ini -s -h attrib %Desktop%\desktop.ini -s -h rem 去除六个文件属性 del /s /q %Video:~10%\desktop.ini del /s /q %Picture:~10%\desktop.ini del /s /q %Document%\desktop.ini del /s /q %Download%\desktop.ini del /s /q %Music:~10%\desktop.ini del /s /q %Desktop%\desktop.ini rem 删除六个名称文件 (echo [.ShellClassInfo] echo LocalizedResourceName=@%SystemRoot%\system32\windows.storage.dll,-21791 echo IconResource=%SystemRoot%\system32\imageres.dll,-189 )>%Video:~10%\desktop.ini (echo [.ShellClassInfo] echo LocalizedResourceName=@%SystemRoot%\system32\windows.storage.dll,-21779 echo IconResource=%SystemRoot%\system32\imageres.dll,-113 )>%Picture:~10%\desktop.ini (echo [.ShellClassInfo] echo LocalizedResourceName=@%SystemRoot%\system32\windows.storage.dll,-21770 echo IconResource=%SystemRoot%\system32\imageres.dll,-112 )>%Document%\desktop.ini (echo [.ShellClassInfo] echo LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21798 echo IconResource=%SystemRoot%\system32\imageres.dll,-184 )>%Download%\desktop.ini (echo [.ShellClassInfo] echo LocalizedResourceName=@%SystemRoot%\system32\windows.storage.dll,-21790 echo IconResource=%SystemRoot%\system32\imageres.dll,-108 )>%Music:~10%\desktop.ini (echo [.ShellClassInfo] echo LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21769 echo IconResource=%SystemRoot%\system32\imageres.dll,-183 )>%Desktop%\desktop.ini rem 创建新的六个文件 attrib %Video:~10%\desktop.ini +s +h attrib %Picture:~10%\desktop.ini +s +h attrib %Document%\desktop.ini +s +h attrib %Download%\desktop.ini +s +h attrib %Music:~10%\desktop.ini +s +h attrib %Desktop%\desktop.ini +s +h rem 添加六个文件属性 (echo Windows Registry Editor Version 5.00 echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace] echo [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}] echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{088e3905-0323-4b02-9826-5d99428e115f}] echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}] echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}] echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{d3162b92-9365-467a-956b-92703aca08af}] echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}] echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}] echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace] echo [-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}] echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{088e3905-0323-4b02-9826-5d99428e115f}] echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}] echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}] echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{d3162b92-9365-467a-956b-92703aca08af}] echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}] echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}] echo [HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}] echo @="OneDrive" echo "System.IsPinnedToNameSpaceTree"=dword:00000000)>6.reg rem 输出注册表文件 regedit /s 6.reg del /s /q 6.reg rem 导入并删除注册表文件 taskkill /f /im Explorer.exe start Explorer.exe |
发表回复