> a) Calling the exe through shell program.
b) Calling the exe through ASPEXEC.
c) Calling the exe through the Batch Files.
Hi,
I'm going to tag along at this thread - dealing with the same problem as
you at the moment.
I have a some .bat files generating .txt files with pings and traceroutes
to certain hosts, and i need to call these .bat files from asp.
I have tried with wscript.shell and AspExec, and also i am not getting any
errors but the files aren't getting executed
I have tried assigning iusr_servername permissions on both tracert.exe, ping.exe,
cmd.exe and the .bat files.
The script combinations i have tried are the following, and the fiels works
fine when calling them manually on the server:
set wshell = server.createobject("wscript.shell")
wshell.Run "cmd.exe /c c:\Inetpub\wwwroot\scripts\script.bat"
set wshell = nothing
set wshell = server.createobject("wscript.shell")
Response.write wshell.run("c:\Inetpub\wwwroot\scripts\script.bat" )
set wshell = nothing
Set Executor = Server.CreateObject("ASPExec.Execute")
Executor.Application = "c:\Inetpub\wwwroot\scripts\script.bat"
Executor.TimeOut = 10000
Executor.ShowWindow = False
Executor.ExecuteWinApp
Set Executor = Server.CreateObject("ASPExec.Execute")
Executor.Application = "cmd.exe"
Executor.Parameters = "/c c:\Inetpub\wwwroot\scripts\script.bat"
Executor.TimeOut = 10000
Executor.ShowWindow = False
Executor.ExecuteWinApp
I have tried with executing as DosApp too and with ShowWindows = True, without
any luck.
I tried the AspExec example tracerouting too, however this didnt work until
i gave iusr_servername permissions at tracert.exe - but which permissions
can be missing when it still aint working in my bat files? they look like
this:
ping -a cnn.com > c:\Inetpub\wwwroot\data\ping.txt
tracert cnn.com > c:\Inetpub\wwwroot\data\traceroute.txt
Could it perhaps be something that denies the bat file to write the textfiles?
I have assigned writing permissions for iusr_servername too, but is there
any application i am missing to assign them to?
And is there anything that i could add to the .bat file so that i could see
if it's even being executed or not?
--
Regards,
Sune