After writing a console program, you want to run it in the background and start it on your own. There is a simple method as follows.
1. running in the background
A simple. vbs file. The implementation method is as follows:
For example, my. exefile is hkserver.exe. You can use text documents to write the following code:
[Vb]
Set wscriptObj = CreateObject ("Wscript. Shell ")
WscriptObj. run "C: \ Users \ HK \ Desktop \ HKServerEditVersion2.4 \ Debug \ HKServer.exe", 0
Save the file as a. vbs file and directly run the. vbs file to run the file in the background.
If it is written:
[Vb]
"HKServer.exe"
The. vbs and. EXE files are in the same directory.
2. Auto Start
Method 1): copy the. vbs file to the Startup Folder.
Method 2): Create a. vbs file shortcut to start --> all programs --> Start folder.
Once the computer is started, the hkserver.exe file can be started automatically.