I need to print the pdf file from the browser, so I have created a custom URL protocol to trigger the bat file, now I need to prevent the command prompt window from opening, also I need to protect the bat file from editing from the user side.
Asked
Active
Viewed 1,561 times
-3
-
1If you don't get an answer here you are looking for you may wish to ask on https://superuser.com/ instead. StackOverflow is for code related questions (maybe there is a code solution for this though?) – sniperd May 16 '19 at 17:46
1 Answers
1
Open notepad and add the below content to it, then save the file as hidebatch.vbs:
echo Set MyScript = CreateObject("WScript.Shell")
echo MyScript.Run "C:\Path\to\your\batchfile.bat", 0, False
Simply replace C:\Path\to\your\batchfile.bat
with the path to your batchfile. Then to launch this, instead of statring up your batchfile, you would run cscript hidebatch.vbs

Gerhard
- 22,678
- 7
- 27
- 43
-
1There is really no way to hide the batch file with batch file code as that feature simply doesn't exist but visual basic is more than accommodating for just this very thing! – Zach Pedigo May 17 '19 at 18:03