Run a bat form an aspx page

G

Guest

Hi all, I want to run a bat form an aspx page. The bat have to move text
files to another location, as show:

@echo off
move /Y c:\prueba\*.txt \\servidor5\conta\buzon\cirreportes\

in the aspx page I have the following code to call the bat. But it doesn't
work, the error is "File not found" Any Ideas?

sTemplate = Server.MapPath(Request.ApplicationPath) & "\Bat\RunMe.bat"
A = Shell(sTemplate, 1)
 
S

Steve C. Orr [MVP, MCSD]

The ASPNET user account that ASP.NET uses by default does not have network
file permissions. Either give the account such network permissions (likely
with the help of your network administrator) or use impersonation to have it
run under a different user account that does have such permissions.
For testing purposes you can have it run under your personal user account.
Here's more info:
http://msdn.microsoft.com/library/d...-us/cpguide/html/cpconaspnetimpersonation.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top