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 Jun 1 '17 at 5:24
  • 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 Jun 1 '17 at 5:25
  • Export a registry key, using regedit, to see how a batch script can modify a key. – Ramhound Jun 1 '17 at 5:31
  • 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 Jun 1 '17 at 5:36
1

Well, with a rather refined search on the web, I found precisely what I was looking for. I found VBS to EXE, the last time I searched for such a tool I found no results. It's actually a great tool, and is very close to their BAT to EXE tool. All you need to do is drag-and-drop your VBS script into the program, choose your options and configuration, then click the compile button.

| improve this answer | |
  • 1
    These links are invalid. – Solomon Antoine Jul 9 '19 at 22:38
  • 1
    Noted, I have updated my answer with current links @Solomon Antoine. – Mr. Mendelli Jul 11 '19 at 1:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.