Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 25th, 2004, 09:39 AM
Registered User
 
Join Date: Nov 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Run a .bat or .exe on server

Hi,

can someone help me please before I go mad. I'm trying to get a bat file to run on the IIS server when a page loads. All the bat file does is create a new directory on the server. However, when the page loads it doesn't report any errors and the bat file doesn't run. I'm using the following:

<%
Set server_shell = Server.CreateObject("wscript.shell")
server_shell.Run ("cmd.exe /c a.bat")
%>

Also, it doesn't matter what path I put to the bat file. Even if I make up a non-existent file name, no error comes back to tell me there is a problem and the page loads as if everything is OK.

What am I doing wrong?

thanks

plong


 
Old February 25th, 2004, 10:16 AM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 205
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Does your IIS directory have Execute rights? If so, try logging on as the user the IIS runs under and execute the bat file. Remember a bat file will not pass back an error if it does not have the proper rights. Last suggestion, you might try creating the directory with the FileSystem Object rather than a bat file. It will throw an error on failure.
 
Old May 9th, 2006, 06:06 AM
Registered User
 
Join Date: May 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have a problem with the same file...my VET antivirus says its a virus of some sort but cant get rid of it
Vet seems to delete the file but then it re copies itself.

only comes up when I boot the computer.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Run bat file as part of Setup project adorable.ashish General .NET 0 March 5th, 2008 07:42 AM
.exe or .bat file and VB.NET MARY9 Pro VB.NET 2002/2003 1 March 8th, 2007 08:08 AM
Run .bat file from Excel VBA Harold Hawken Excel VBA 2 June 23rd, 2005 03:03 PM
Run an exe julesmel C# 1 August 6th, 2003 10:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.