Note: "automation error" is actually an error returned by a program or component when VB calls the program or component. Therefore, whether these components can run properly must be considered.
For example, when you run the following code on some machines:
Dim wshshell as object <br/> set wshshell = Createobject ("wscript. Shell") <br/> runandwaitexe = wshshell. Run (strcommand, 0, true)
"Automation error" occurs because "wscript. Shell" cannot run properly.
Bytes -------------------------------------------------------------------------------------------------------------------------
The following method is switched from the network, and the problem has been solved successfully!
The following error message is returned: wsript.exe cannot find the entry. You cannot create an object named "wscript. Shell. So I started to go crazy about Baidu because either the script is disabled (not possible, because the pop-up message is coming), or the file is changed. On the Internet, it is generally okay to register two components, as shown below:
Regsvr32 srcrun. dll (command successful)
Regsvr32 wshom. ocx (error prompt: unable to locate the program Input Point doopenpipestream on the Dynamic Link Library scrrun. dll)
If the previous execution is successful and the last one is an error, the message is "loadlibary (" wshom ") failed and the specified program cannot be found". Then, I checked the system 32 directory and wshom. OCX does. Later, I realized that wshom. ocx was damaged, so I found a computer of the same version (My XP SP3), wrote a script, and copied the following files:
Mkdir C:/Repair
Set Source = % WINDIR %/system32
Set target = C:/Repair
Copy % source %/cscript.exe % target %
Copy % source %/jscript. dll % target %
Copy % source %/scrobj. dll % target %
Copy % source %/scrrun. dll % target %
Copy % source %/VBScript. dll % target %
Copy % source %/wscript.exe % target %
Copy % source %/wshext. dll % target %
Copy % source %/wshom. ocx % target %
Pause
And copy the C:/repair directory on the other machine to my C:/, and then update it with the following script:
Set Source = C:/Repair
Set target = % WINDIR %/system32
Copy % source %/cscript.exe % target %
Copy % source %/jscript. dll % target %
Copy % source %/scrobj. dll % target %
Copy % source %/scrrun. dll % target %
Copy % source %/VBScript. dll % target %
Copy % source %/wscript.exe % target %
Copy % source %/wshext. dll % target %
Copy % source %/wshom. ocx % target %
Regsvr32 % target %/jscript. dll
Regsvr32 % target %/scrobj. dll
Regsvr32 % target %/scrrun. dll
Regsvr32 % target %/VBScript. dll
Regsvr32 % target %/wshext. dll
Regsvr32 % target %/wshom. ocx
Pause
Then, run the script to test Createobject ("wscript. Shell,