jknuce
asked on
Status "Open" for Reg.exe Load when launched using the WshShell Exec Method
I am loading a Win PE registry hive using a VBscript and the WshShell exec method. I am using the status property as a indicator to proceed. However, the status returned is always 0, even after the registry hive is loaded. Am I doing something wrong?
Option Explicit
Call ExecCmd("%comspec% /k reg.exe load HKLM\WIM_SOFTWARE ""C:\PE2-Image\mount\windows\system32\config\software""")
Sub ExecCmd(cmd)
Dim objShell,objExec
Set objShell = CreateObject("WScript.Shell")
Set objExec = objShell.Exec(cmd)
Do While objExec.Status = 0
Wscript.echo "Process Still Open = " & objExec.Status
wscript.Sleep 100
Loop
Wscript.echo "Process Closed = " & objExec.Status
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You're welcome, thanks for the grade. The other thing I was going to say was that I'm not sure you even to call reg.exe within a Cmd window: Reg.exe is a program in its own right, so you may only just need to:
Regards,
Daz.
Call ExecCmd("reg.exe load HKLM\WIM_SOFTWARE ""C:\PE2-Image\mount\windows\system32\config\software""")
Regards,
Daz.
ASKER