SoFunction
Updated on 2025-03-09

Implementation code for hiding cmd command line running box using object

1. (Windows Script Host Runtime Library) is an object, and the corresponding file is C:\WINDOWS\system32\, which is a component that the server system will use. shell means "shell". This object can perform commonly used operations in the operating system shell, such as running programs, reading and writing registry, environment variables, etc. This object is usually used in VB or VBS programming.

2. Installation object: regsvr32
Uninstall the object: regsvr32 -u or regsvr32 /u
3. For example, assume that the mytest*.iso files are all in the C: root directory. Create the mytest directory and copy the mytest*.iso file to the mytest directory.

Create the file and save it in the root directory of C:.
Copy the codeThe code is as follows:

md mytest
copy c:\mytest*.iso mytest
pause

Double-click to see the newly created mytest directory and the copied mytest*.iso file.



If you hide the cmd command line window, there are two ways.

(1) Create an object, run the file directly from the object, and the corresponding vbs file:, double-click to see the effect.
Copy the codeThe code is as follows:

dim objShell
set objShell=("")
iReturnCode=("c:\",0,TRUE)

(2) Create an object, and directly run the dos command and the command in it, corresponding vbs file:
Copy the codeThe code is as follows:

dim objShell
set objShell=("")
iReturnCode=(" /c md mytest",0,TRUE)
iReturnCode=(" /c copy c:\mytest*.iso mytest",0,TRUE)