Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Executing a batch file...

Status
Not open for further replies.

cglinn

Programmer
Sep 3, 2003
44
US
I am trying to run a batch file on the server through ASP. Below is my setup.

The batch file resides here:
C:\Batch Files\testbat.bat

It runs a couple executable files located in the same folder.

I have tried using Microsoft's Wscript.shell and the ASPExec free component.

I can get the batch process kicked off. However, the first executable shows up in the server's task manager but never completes and moves on to the next step in the batch file. It appears to just freeze. I can only imagine that it is some sort of permissions thing, but I have tried adding the IUSR account to the administrators group and the same thing happens. Any suggestions?

Thanks in advance!
 
I'm afraid you're in a wrong forum.
Do a keyword search for batch in the Microsoft: Active Server Pages (ASP) Forum : forum333

Hope This Help
PH.
 
I actually posted this question there first, but thought since I was doing it through vbscript someone here might have some experience with this too, but thank you.
 
Hi cglinn,
Below is a script that runs a cobol program and
then runs a pkzip backup. On the ss.run line the
,1,true makes the script wait till the current operation is
complete before going on to the next code in the script.
Keeps a time line in order that everything doesn't happen all at the same time.
Enjoy Bob


Set ss = CreateObject("WScript.Shell")
ss.run "C:\RMCOBOL\RUNCOBOL.EXE C:\COBOLTEST\RSUPDATE K L=c:\rmcobol\RMBARS.DLL L=c:\rmcobol\C$BITMAP.DLL ",1,true
set ss = nothing



returncode=msgbox ("mount a 3.5 diskette for backup",65,"backup start")
if returncode=1 then
Set ss = CreateObject("WScript.Shell")
ss.run "COMMAND /C C:\util\pkzip.exe a:master05.zip y:\rds\rds05\master.txt ",1,TRUE
msgbox "backup is done please remove the diskette",64,"backup finished"
end if
 
This should work then:

sub btnCreate_onclick()
Set server_shell = Server.CreateObject("wscript.shell")
server_shell.Run "c:\QSL_LITE_DPC\nightly\dpc_dbcreate.bat", 1, True
' call started()

end sub
---------------------------------------------
<%
function started()
Response.Write &quot;<script language=javascript>&quot;
Response.Write &quot;alert('Database creation started.');&quot;
Response.Write &quot;window.location.href = 'qsl_createDB.asp';&quot;
Response.Write &quot;</script>&quot;

end function
%>

-------------------------------------------

The above code is what I am using. Does something look wrong here, because I still experience the process freezing.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top