View Single Post
  #1  
Old 10-09-2013, 09:50 AM
makotech222 makotech222 is online now
Registered User
 
Join Date: 10-01-2013
Posts: 2
Can't use Wscript.Shell when moved to Win7 x64

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:
Code:
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
Reply With Quote