juliandormon
asked on
problem launching bat file from vbs script.
I'm trying to fire a bat file from within a vbs file - I see that cmd.exe launches in task manager, but it does not execute. I'm not sure how to debug this either.
The bat file runs flawlessly on its own.
Here's the vbs:
OPTION EXPLICIT
dim websites
dim websitearray
Dim i
Dim domain
Dim wshell
websites = "dmooreartist.com artist1111.com"
websitearray = split(websites," ")
For i = 0 to ubound(websitearray)
changethedns(websitearray( i))
Next
SUB changethedns ( domain )
WScript.Echo domain
set wshell = createobject("wscript.shel l")
wshell.run "%comspec% /c C:\Documents and Settings\Administrator\Des ktop\myIIS Scripts\ch angedns.ba t " & domain, 0, True
set wshell = nothing
END SUB
The bat file runs flawlessly on its own.
Here's the vbs:
OPTION EXPLICIT
dim websites
dim websitearray
Dim i
Dim domain
Dim wshell
websites = "dmooreartist.com artist1111.com"
websitearray = split(websites," ")
For i = 0 to ubound(websitearray)
changethedns(websitearray(
Next
SUB changethedns ( domain )
WScript.Echo domain
set wshell = createobject("wscript.shel
wshell.run "%comspec% /c C:\Documents and Settings\Administrator\Des
set wshell = nothing
END SUB
ASKER
same problem unfortunately.
ASKER
is there a way to loop through my array in a bat file? instead of looping in the vbs? this would also get the job done if possible, though I have no idea of how to accomplish this.
ASKER
Thanks I can actually do this by calling the cmds directly that are found in the BAT file.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
wshell.run "%comspec% /c " & chr(34) & "C:\Documents and Settings\Administrator\Des