1
I have a visual basic script I found years ago, I would like to know if it can be entirely or at least roughly translated into batch format. The goal is to convert the script to batch format, so that I can use BAT to EXE to convert the resulting batch file into an executable binary. The script hides or shows hidden files, here's the scripts contents:
Hidden = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden"
SSHidden = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden"
Set Command1 = WScript.CreateObject("WScript.Shell")
Set command2 = CreateObject("Wscript.Shell")
Check = Command1.RegRead(Hidden)
If Check = 2 Then
Command1.RegWrite Hidden, 1, "REG_DWORD"
Command1.RegWrite SSHidden, 1, "REG_DWORD"
Else
Command1.RegWrite Hidden, 2, "REG_DWORD"
Command1.RegWrite SSHidden, 0, "REG_DWORD"
End If
Command1.SendKeys "{F5}"
WScript.sleep 1000
I'm not a professional programmer, but I have seen VBS translated to batch before, I just don't know all of the ins-and-outs of how to do so. I could make two batch scripts, one to hide, one to show, but the VBS script does both. I would like to retain this singularity. Thanks in advance.
Yes, you can modify the registry use Batch code, but why would you if the VB script works? – Ramhound – 2017-06-01T05:24:48.983
Because I am going to use BAT to EXE converter, I just prefer to convert my utility scripts into exe binary format. I like to add things like icons and version information as well, so I suppose it's more for athletics. – Mr. Mendelli – 2017-06-01T05:25:49.640
Export a registry key, using regedit, to see how a batch script can modify a key. – Ramhound – 2017-06-01T05:31:42.017
I did, but it will only give me one method, hide, or show. I like the scripts ability to detect what the current setting is, then change it to the opposite state. I do appreciate your input on the matter though. – Mr. Mendelli – 2017-06-01T05:36:30.640