I have a vbscript that creates a directory, copies a .exe to it and then
should run that . exe, waiting for the end of the execution in order to do
some other actions, such as copying another file to that directory
overwriting one created by the execution. The problem is that when it tries
to run the program, it just opens an explorer window in â??c:\â??, gives an
vbscript error: â??Unable to wait for processâ??, code:80020009, Source:
WshShell.Run, and exits with return code = 0! The code is:
Dim fso, wshshell, sProgDir, sOraRrpOrig, sOraRrpIniOrig, sOraRrpDir
Set fso = CreateObject("Scripting.FileSystemObject")
set WshShell = CreateObject("Wscript.Shell")
'sOraRrpOrig = "f:\instala_script\OraRrp\orarrp.exe"
sOraRrpOrig = "f:\OraRrp\orarrp.exe"
sOraRrpDir = "C:\Program Files\OraRrp\"
sProgRun = " ""c:\Program Files\OraRrp\OraRrp.exe"" -i -s"
Set f = fso.CreateFolder(sOraRrpDir)
fso.CopyFile sOraRrpOrig, sOraRrpDir
sReturn = WshShell.Run(sProgRun, 1, True)
if Sreturn = 0 Then
WScript.Echo "Finished installing OraRrp!"
Else
WScript.Echo "Error executing OraRrp.exe! R/C: " & sReturn
End if
I canâ??t see whatâ??s wrong with the code, and Iâ??m almost insane trying to get
this to work. Does anybody can help me with this?
Thanks in advance.
Americo