navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Free FrontPage Templates

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Running a BAT file from a webpage

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Running a BAT file from a webpage
Page: [1]
 
and13345

 

Posts: 100
Joined: 10/7/2003
Status: offline

 
Running a BAT file from a webpage - 2/22/2005 11:48:55   
I need to kick off a batch file when a user clicks a button on my webpage. I have setup a page with a form that has a button that will POST to an ASP page. On that page I simply want to start the BAT file and then redirect back to the original page. My problem is how to start that bat file. The file exists locally on the users computer in a specific folder. If you go out and double click on the BAT file it runs and does everything I need it to do, I just can't figure out how to get my ASP page to run that BAT file. I have Googled for the answer and it looks like some SHELL command should work, but I get a type mismatch error when it runs the page.

Below is the code I have tried. I am just using the message box to make sure the page is starting correctly. I get the msgbox just fine and click OK and then get the error.
The response.write at the end is just for testing. After I get the error and say NO to debug it writes that line on the resulting page.

Any suggestions?

<SCRIPT LANGUAGE=VBScript>
'Script runs Batch file on local PC that executes VBScript to upload file.
	MsgBox "Click OK to execute the SHELL command.", 65, "Run BAT File."
	Shell "C:\soj\calendar\exportcalendar_upload.bat"
'End of script.
</SCRIPT>
<%
response.write "This is the exportcalendar_upload_bat.asp file"
%>
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Running a BAT file from a webpage
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts