The bat file and some exe files used for debugging will use the terminal to output debugging information. However, during the demonstration, you usually want to hide the black window. There are two methods. The first method is to re-compile the program and remove the terminal output from the compilation options, but this is sometimes troublesome. The following is a simple method:
Enter the following content in Notepad:
Set ws = CreateObject ("Wscript. Shell ")
Ws. run "cmd/c filename. bat", vbhide
Or
Set ws = CreateObject ("Wscript. Shell ")
Ws. run "cmd/c filename.exe", vbhide
Note: filename.batand filename.exe are the names of the batch to be executed.
Save as the aaa. vbs file.
Then, use the rarfile to compress the aaa.vbs file and filename.bat(or filename.exe) file. In the general item, check "create self-decompressed compressed file" and "lock compressed file,
Then, "advanced" -- "self-extracting options" -- "general" -- "decompress and run" and enter aaa. vbs
Select "Mode"> "quiet mode" (hide all)> "Overwrite mode" (overwrite all files)
Then, generate the EXE executable file. Then, run the EXE file and you will hide the CMD window.