Link to home
Start Free TrialLog in
Avatar of juliandormon
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.shell")
wshell.run "%comspec% /c C:\Documents and Settings\Administrator\Desktop\myIISScripts\changedns.bat "  & domain, 0, True
set wshell = nothing

END SUB
Avatar of sirbounty
sirbounty
Flag of United States of America image

Change this line:

wshell.run "%comspec% /c " & chr(34) & "C:\Documents and Settings\Administrator\Desktop\myIISScripts\changedns.bat " & chr(34)  & domain, 0, True
Avatar of juliandormon
juliandormon

ASKER

same problem unfortunately.
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.
Thanks I can actually do this by calling the cmds directly that are found in the BAT file.
ASKER CERTIFIED SOLUTION
Avatar of sirbounty
sirbounty
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial