makotech222
10-09-2013, 09:50 AM
Hello, I have a problem with this script i have ported.
We recently updated from winxp x32 to win7 x64, and my vbscript command is having problems running cmd commands. If i manually copy and paste the command, it works fine in cmd, but if i run it through vbscript wshell, it fails.
I'm using VB 7.7a, do i need to upgrade? Thats the only thing i can think of that might cause it.
Here's what a snip of the code looks like:
Function ExecuteCommand(command)
Dim oShell
Set oShell = WScript.CreateObject("WSCript.shell")
Builder.LogMessage "Executing command: " & command
Builder.LogMessage "---------------------------------"
Set result = oShell.Exec(command)
Builder.LogMessage "---Console Output:"
With result
Do While .Status = 0
WScript.Sleep 10
Do While Not .StdOut.AtEndOfStream
Builder.LogMessage "| " & .StdOut.ReadLine
Loop
Loop
End With
Builder.LogMessage "---------------------------------"
End Function
We recently updated from winxp x32 to win7 x64, and my vbscript command is having problems running cmd commands. If i manually copy and paste the command, it works fine in cmd, but if i run it through vbscript wshell, it fails.
I'm using VB 7.7a, do i need to upgrade? Thats the only thing i can think of that might cause it.
Here's what a snip of the code looks like:
Function ExecuteCommand(command)
Dim oShell
Set oShell = WScript.CreateObject("WSCript.shell")
Builder.LogMessage "Executing command: " & command
Builder.LogMessage "---------------------------------"
Set result = oShell.Exec(command)
Builder.LogMessage "---Console Output:"
With result
Do While .Status = 0
WScript.Sleep 10
Do While Not .StdOut.AtEndOfStream
Builder.LogMessage "| " & .StdOut.ReadLine
Loop
Loop
End With
Builder.LogMessage "---------------------------------"
End Function