Most of the time we wondering that how to run a batch file without launching a “command window” or run batch file invisibly. Even people search it on internet but didn’t find a proper solution means the solutions they found are very complicated.
But here today I provide you a proper and very simple trick to execute batch files invisibly. For this trick we only have to create a Vbs file [Vbs = Visual basic Script] which working as a Bat Launcher. So without wasting time coming to the trick, Follow the steps listed below:-
Step1:- Open Notepad.
Step2:- Copy/paste below code (any one of your choices both works same):-
Set oShell = CreateObject ("Wscript.Shell")Dim strArgsstrArgs = "cmd /c filename.bat"oShell.Run strArgs, 0, false
Set objShell = CreateObject("WScript.Shell")strCommand = "C:\Users\Prince\Desktop\filename.bat"objShell.Run strCommand, vbHide, TRUE
Step 3:- Now save this Files as “Anything.vbs”
Note: - Change the highlighted part with you filename and File path in code1 and code2 respectively.
Step 4:- Now every time when you want to open your batch file invisibly just double click on the file “Anything.vbs”, which we created earlier in tutorial.
How to End the Hidden process [Testing time]
The only way to end the process is to open the task manager [right click on the windows taskbar then click on Start Task Manager] and kill the process that says WScript & conhost.