标题: [问题求助] 这个VBS为啥改不了注册表,难道这有毒 [打印本页]
作者: smss 时间: 2019-1-9 16:20 标题: 这个VBS为啥改不了注册表,难道这有毒
- Dim WSHShell
- Set WSHShell = WScript.CreateObject("WScript.Shell")
- sTitle1 = "SSH=0"
- sTitle2 = "SSH=1"
- if WSHShell.RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden") = 1 then
- WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden", "0", "REG_DWORD"
- WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden", "2", "REG_DWORD"
- WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt", "1", "REG_DWORD"
- WSHShell.RegWrite "HKEY_CLASSES_ROOT\Directory\Background\shell\show", "显示系统文件+扩展名", "REG_SZ"
- WSHShell.SendKeys "{F5}+{F10}"
- 'WSHShell.Popup "Poof, they're gone", 1, sTitle1, vbInformation
- else
- WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden", "1", "REG_DWORD"
- WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden", "1", "REG_DWORD"
- WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt", "0", "REG_DWORD"
- WSHShell.RegWrite "HKEY_CLASSES_ROOT\Directory\Background\shell\show", "隐藏系统文件+扩展名", "REG_SZ"
- WSHShell.SendKeys "{F5}+{F10}"
- 'WSHShell.Popup "Here they are", 1, sTitle2, vbInformation
- end if
- Set WSHShell = Nothing
- WScript.Quit(0)
复制代码
这个为啥改不了注册表
WSHShell.RegWrite "HKEY_CLASSES_ROOT\Directory\Background\shell\show", "显示系统文件+扩展名", "REG_SZ"
WSHShell.RegWrite "HKEY_CLASSES_ROOT\Directory\Background\shell\show", "隐藏系统文件+扩展名", "REG_SZ"
路径是对的 其它键值可以改 这2条为啥改不了难道这有毒
作者: ivor 时间: 2019-1-9 20:13
you don't have permission possible.
作者: 窄口牛 时间: 2019-1-10 07:02
vbs的权限低,批处理比它高些。
作者: smss 时间: 2019-1-11 21:12
vbs的权限低,批处理比它高些。
窄口牛 发表于 2019-1-10 07:02
WSHShell.run "C:\Windows\1.bat",0
...
WSHShell.run "C:\Windows\2.bat",0
...
1.bat和2.bat中分别写入解决 只是又多了两个BAT
reg add HKEY_CLASSES_ROOT\Directory\Background\shell\show1 /d "显示文件+扩展名" /f
reg add HKEY_CLASSES_ROOT\Directory\Background\shell\show1 /d "隐藏文件+扩展名" /f
有什么法子合成一个Bat让这运行一次就可以切换一次
@Batcher
作者: ivor 时间: 2019-1-11 21:47
- reg query HKEY_CLASSES_ROOT\Directory\Background\shell\show1 | find "显示" >nul && reg add HKEY_CLASSES_ROOT\Directory\Background\shell\show1 /d "隐藏文件+扩展名" /f || reg add HKEY_CLASSES_ROOT\Directory\Background\shell\show1 /d "显示文件+扩展名" /f
复制代码
欢迎光临 批处理之家 (http://bathome.net./) |
Powered by Discuz! 7.2 |