By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,660 Members | 1,593 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,660 IT Pros & Developers. It's quick & easy.

Run Batch file from asp page on local PC

P: 1
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,


Expand|Select|Wrap|Line Numbers
  1.       <%
  2.     DIM wShell
  3.         Set wShell = Server.CreateObject("Wscript.Shell")
  4.         wShell.Run "C:\Users\newtest\Desktop\abc.bat"
  5.         Set Shell = Nothing
  6.     response.write("1")
  7.       %>
and abc.bat file code is,

Expand|Select|Wrap|Line Numbers
  1.       ren "C:\Users\newtest\Desktop\abc.Txt" "xyz.txt"
  2.       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.
Jan 23 '15 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.