Run Batch file from asp page on local PC

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hirenmodi
    New Member
    • Jan 2015
    • 1

    Run Batch file from asp page on local PC

    Hello friends,

    I am trying to run batch file from asp page SyncFunc.asp which can be redirected on click event of Submit button, located on Sync.asp page.

    My SyncFunc.asp page code is as below,


    Code:
          <%
    	DIM wShell
            Set wShell = Server.CreateObject("Wscript.Shell")
            wShell.Run "C:\Users\newtest\Desktop\abc.bat"
            Set Shell = Nothing
    	response.write("1")
          %>
    and abc.bat file code is,

    Code:
          ren "C:\Users\newtest\Desktop\abc.Txt" "xyz.txt"
          PAUSE

    when i run this it displays "1" on SyncFunc.asp page without error but doesn't perform any affects as per batch file code. so, Plz help me to solve this issue.
    Last edited by Rabbit; Jan 23 '15, 04:49 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
Working...