Search code examples
asp-classicbatch-fileexecuteshellexecute

How do i execute DOS batch file in web server by ASP


In my asp page, i want to provide a button for user to click and then execute a DOS batch file in server (e.g. C:\Batch\copy.bat in web server).

How can i do it ? Thanks

I had tried

<% 
    set wshell = CreateObject("WScript.Shell") 
    wshell.run "c:\file.bat" 
    set wshell = nothing 
%> 

but it doesn't work and seems it run c: on user pc, not web server.

regards,

Joe


Solution

  • look here :

    http://classicasp.aspfaq.com/general/how-do-i-execute-a-dos-command/batch-file/exe-from-asp.html