473,432 Members | 1,422 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,432 software developers and data experts.

Run a bat form an aspx page

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)





Nov 19 '05 #1
2 1441
You need to try and use process.start to run batch file. You would
probably be better off using the file.move method in the framework already
however.

http://msdn.microsoft.com/library/de...smovetopic.asp

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"Carmen de Lara" <Ca**********@discussions.microsoft.com> wrote in message
news:9B**********************************@microsof t.com...
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)




Nov 19 '05 #2
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/de...ersonation.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Carmen de Lara" <Ca**********@discussions.microsoft.com> wrote in message
news:9B**********************************@microsof t.com...
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)




Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Kathy Burke | last post by:
HI. in asp.net app, I have an xmlDocument that I transform to the client html. Using xsl I create a few textboxes to capture user input. Each of these are related to <data> elements in the xmlDoc....
2
by: Jeff Baker | last post by:
How does one post to an ASPX page using the WebClient when the form name is required?
3
by: Chung | last post by:
Hi all, I have used the following code for doing the form submission. I don't think this is a right way to submit a from to a new aspx page because I need to add a dummy form in between. Could...
11
by: Tom | last post by:
Hi all, I posted the same question one week ago in http://communities.microsoft.com/newsgroups/previewFrame.as p? ICP=msdn&sLCID=us&sgroupURL=microsoft.public.dotnet.framewo...
5
by: Eric Shin | last post by:
Hi all. I'm like really on the beginning stage for ASP.NET just got a few questions to ask... Please help me. I've created a form page called "join.aspx" and it has lots of codes but the...
4
by: COHENMARVIN | last post by:
I'm a asp programmer starting out with asp.net. I understand that an asp form can post to its own page and that this allows validation of form fields on the server. But suppose all the controls...
4
by: Alex Maghen | last post by:
I have a master page which contains a general page framework and also contains a <form runat=server> around most of the content of the page. Inside that <form> tag is a ContentPlaceholder. I...
4
by: pbd22 | last post by:
hi. could somebody tell me, when uploading a file, i know the form where the upload component is must have enctype=multipart/form-data but, is the same true for the form with the server code to...
19
by: Coward 9 | last post by:
HI, I saw in an example hello.aspx, there is a <form tagbeing used like <form runat="server> I search all html tag references and could NOT find "runat" attributes for <formtag. which...
6
by: Aussie Rules | last post by:
Hi, I have an asp.net 2.0 page that has two sections. Each section allows the user to enter a value into a text box, click a button and then perform some function. Each text boxes function is...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.