Running .BAT or .CMD files hidden (invisible mode) Using Script
Windows Script Host’s Run Method allows you run a program or script in invisible mode. Here is a sample Windows script code that launches a batch file named syncfiles.bat
invisibly.
Reference: Run Method. Setting intWindowStyle parameter to 0 hides the window.
Let’s say we have a file named syncfiles.bat
in C:\Batch Files
directory. Let’s launch it in hidden mode using Windows Scripting.
Copy the following lines to Notepad.
Set WshShell = CreateObject("WScript.Shell") WshShell.Run chr(34) & "C:\\Batch Files\\syncfiles.bat" & Chr(34), 0 Set WshShell = Nothing
Note: Replace the batch file name/path accordingly in the script according to your requirement.
Save the file with .VBS extension, say
launch_bat.vbs
Edit the .BAT file name and path accordingly, and save the file.
Double-click to run the launch_bat.vbs file, which in-turn launches the batch file
syncfiles.bat
invisibly.
Source: https://www.winhelponline.com/blog/run-bat-files-invisibly-without-displaying-command-prompt/