批处理之家's Archiver

smss 发表于 2019-1-9 16:20

这个VBS为啥改不了注册表,难道这有毒

[code]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)[/code]这个为啥改不了注册表
WSHShell.RegWrite "HKEY_CLASSES_ROOT\Directory\Background\shell\show", "显示系统文件+扩展名", "REG_SZ"
WSHShell.RegWrite "HKEY_CLASSES_ROOT\Directory\Background\shell\show", "隐藏系统文件+扩展名", "REG_SZ"
路径是对的 其它键值可以改 这2条为啥改不了难道这有毒{:2_38:}

ivor 发表于 2019-1-9 20:13

you don't have permission possible.

窄口牛 发表于 2019-1-10 07:02

vbs的权限低,批处理比它高些。

smss 发表于 2019-1-11 21:12

[quote]vbs的权限低,批处理比它高些。
[size=2][color=#999999]窄口牛 发表于 2019-1-10 07:02[/color] [url=http://bbs.bathome.net/redirect.php?goto=findpost&pid=216666&ptid=51820][img]http://bbs.bathome.net/images/common/back.gif[/img][/url][/size][/quote]
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

[code]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[/code]

页: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.