0

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

Joe Yan
  • 1,785
  • 7
  • 40
  • 61
  • 1
    Make sure your security settings are set, possible duplicate: http://stackoverflow.com/questions/5644689/how-to-execute-a-bat-file-from-a-classic-asp-page-on-the-server – Robert Dec 28 '11 at 14:18

1 Answers1

-1

look here :

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

Dee
  • 1,432
  • 1
  • 9
  • 8