1. wscript. shell (Windows Script Host Runtime Library) is an object corresponding to c: \ windows \ system32 \ wshom. OCX, wscript. shell is a component used by the server system. Shell is the meaning of "shell". This object can perform common operations on the operating system shell, such as running Program , Read and write the registry, environment variables, and so on. This object is usually used in VB or vbs programming.
2. Install wscript. Shell object: regsvr32 wshom. ocx
Uninstall wscript. Shell object: regsvr32-u wshom. ocx or regsvr32/u wshom. ocx
3. For example, assume that all the mytest *. ISO files are in the C: root directory. Create the mytest directory and copy the mytest *. ISO file to the mytest directory.
Create the testcopy. BAT file and store it in the C: root directory.CopyCodeThe Code is as follows: MD mytest
Copy c: \ mytest *. ISO mytest
Pause
Double-click testcopy. dat to view the newly created mytest directory and the copied mytest *. ISO file.
You can use either of the following methods to hide the CMD command line window.
(1) create a wscript. Shell object that runs the testcopy. dat file. The corresponding vbs file: testcopy1.vbs. Double-click testcopy1.vbs to see the effect.Copy codeThe Code is as follows: dim objshell
Set objshell = wscript. Createobject ("wscript. Shell ")
Ireturncode = objshell. Run ("C: \ testcopy. Bat", 0, true)
(2) create a wscript. Shell object, which directly runs the doscommand and the command in testcopy. dat. The corresponding vbs file is testcopy2.vbs.Copy codeThe Code is as follows: dim objshell
Set objshell = wscript. Createobject ("wscript. Shell ")
Ireturncode = objshell. Run ("cmd.exe/c md mytest", 0, true)
Ireturncode = objshell. Run ("cmd.exe/C copy c: \ mytest *. ISO mytest", 0, true)