General discussion

Locked

Execute a DOS batch file in ASP??

By Mike@IHS ·
Hi,

I have this ASP code that used to work fine running on an NT4.0 Server platform, and now it's not running at all under Windows 2000 Server.

Here's the ASP code:
(parseinfo.asp)
<% @Language = "VBScript" %>
<%

Call RunBatch()

Function RunBatch()
Dim RunDos
Set RunDos = CreateObject("WScript.Shell")
RunDos.Run "c:\bat\routernt.bat"

End Function
%>

This simple ASP code would execute a DOS batch file when submitted from this HTML FORM:
<html>
<head>
<title>TEST</title>
</head>
<body>
<FORM ACTION="/scripts/parseinfo.asp" METHOD="POST">
<INPUT TYPE="submit" VALUE="Do IT!" WIDTH="20" HEIGHT="10">
</FORM>
</body>
</html>

I don't know what could be preventing it from executing the batch file, my scripts virtual directory has appropriate rights to execute scripts.

I've downloaded the most recent WSH scripting package from Microsoft.

Does anybody know what could be different in Windows 2000 Server , or IIS configuration that could cause this!?

Any input would be greatly appreciated!

thanks!

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Execute a DOS batch file in ASP??

by Jay Eckles In reply to Execute a DOS batch file ...

In what way and at what place is your code failing? Is it failing at the CreateObject line? Is it failing at the RunDos.Run line? Is the ASP not failing at all, but the batch doesn't run? We need more details.

Collapse -

Execute a DOS batch file in ASP??

by Mike@IHS In reply to Execute a DOS batch file ...

Hard to say where it is failing. It definately is failing when executing the batch file. I've tried different command in the batch file, for example "del c:\test.txt". This command gets executed fine, but when I try to execute some othercommand strings (with full path to executables), the command strings don't get executed.

It seems to accept only certain commands.

Collapse -

Execute a DOS batch file in ASP??

by ananthap In reply to Execute a DOS batch file ...

Not much into ASP, but lots in DOS. So here goes.

Yr last answer seems to indicate that "internal" progs like "del" work but external (requiring full path) don't.

So maybe, gather all the external DOS progs u need and place them in a virtual directory under the URL.

Maybe it will work.
End of mail.

Collapse -

Execute a DOS batch file in ASP??

by Mike@IHS In reply to Execute a DOS batch file ...

Poster rated this answer

Collapse -

Execute a DOS batch file in ASP??

by Mike@IHS In reply to Execute a DOS batch file ...

This question was closed by the author

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums