General discussion
-
Topic
-
I could not run a batch file from my ASP page, help needed!
LockedHi,
I have an ASP website that our group will use to gather info. When a visitor of the webpage enters data, the webpage creates a batch file on the server using user submitted data, and the batch file would run an executable on the server.
My problem is I can’t get the batch file to run on the server. I have checked the server and it successfully creates a batch file. I have verified that the batch file did not run because the results of the batch file is not written on the server, but if I manually run (I’m logged in as administrator) the batch file, it creates results.
I have even tried to give IUSR with administrator priveleges just to check if it could execute the batch file on the server. But still it didn’t work.
Here is the script:
Set TestJob = TxtFSO.CreateTextFile(“C:\Inetpub\wwwroot\gather.bat”)
TestJob.WriteLine “gather.exe -a -c”
TestJob.CloseDim wshell, intReturn
set wshell = server.createobject(“wscript.shell”)
intReturn = wshell.run(“C:\Inetpub\wwwroot\gather.bat”, 0, True)
Response.Write( intReturn )
set wshell = nothingNeed help on this, guys!
I’m not really a web developer and I want to keep the webpage simple. I just want it to run the batch file.