473,583 Members | 2,875 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with calling a batch file from a .net web service

4 New Member
Hi to all,
I have made a web service which creates a batch file in a folder in web server and tries to execute it (in a Windows Server 2003 web server). So far I have managed to create the batch file successfully by adjusting the permissions of the folder it is created in, for the user which is assigned to run the web application for the specific application pool. But when the web service tries to execute the newly created batch file (using the System.Diagnost ics.Process class), I get this exception :

System.Componen tModel.Win32Exc eption: Access is denied

at System.Diagnost ics.Process.Sta rtWithShellExec uteEx(ProcessSt artInfo startInfo)

at System.Diagnost ics.Process.Sta rt()

at MyService.MakeB atchFileAndRun( String xmlString) in

c:\wwwroot\App_ Code\TestWadjaM usicService.cs: line 46

My first question is this: Is it possible to execute a batch file through a web service? If it's not, it's not worth trying to do it.

And if it's possible (I hope so), which is the user context of the opening process? Is the ASP.NET user which runs this process or someone else?
If it indeed is the ASP.NET user, I have given him the permissions to execute scripts in the folder of the newly created batch file but still I get an exception. Anyway, any opinion would be extremely helpful. Thanks in advance.
Dec 6 '07 #1
0 1362

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

Similar topics

8
5460
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I...
0
1367
by: ranga | last post by:
>> Does WebService support calling methods in a batch. I have the following two scenarios: case1 : say i need to call two webservice methods that do an insert and update respectively on a database. How do i enclose the 2 calls in a batch/transaction case2: say the 2 methods that i want to call in a batch are "get" type of methods - ie...
0
2567
by: Steve Jorgensen | last post by:
I remember that I used to set up utility batch files, and create Windows shortcuts to them that would ask the user for parameters to supply to the batch files. From what I can tell, this functionality simply doesn't exist anymore in Windows 2000 or above. I did find a work-around to this that I thought y'all might want to know about. ...
1
5788
by: Bucky Pollard | last post by:
I have a web service that needs to create a batch file and call it (since there are no APIs for the functionality I am looking for). I am using the Process and ProcessStartInfo objects. When I try to call the batch file, it just returns with a return code of 1. When I call cmd.exe, and pass the batch file as a parameter it hangs. After much...
13
3608
by: Siegfried Heintze | last post by:
I refered the engineer at my hosting service to http://support.microsoft.com/default.aspx?scid=kb;en-us;825738 where he tried to follow the directions there. He said there was no such file: Document settings\ServerName\ASPNET\Local settings\Temp I said it must be a typo, they meant to say c:\Documents And Settings\Server...
3
7570
by: JoelBrimm | last post by:
I have a batch file that executes a command line utility to do a secure file copy from our server to a 3rd party server. The batch file works fine, but when I call it from the web service the log file shows that it hangs up on the execution of the utility ( an exe ). Batch files without an exe work fine. I also tried running the exe from...
11
3736
by: Nurit N | last post by:
This is the third newsgroup that I'm posting my problem. I'm sorry for the multiple posts but the matter becoming urgent. I hope this is the right place for it... I have created a very simple batch file (echo hello world) and was trying to retrieve the standard output but every time I run the code it returns ExitCode as 1.
0
5546
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
5
3291
by: dm3281 | last post by:
I'm really starting to hate writing services -- or trying to, anyway. Why do I need to rename my project to the service name? Why do I need to set the "ServiceName" property to my service name? Why do I need to set a property within my code to the service name? Are all these required or am I just doing this for consistency purposes?
0
7888
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7811
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7922
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8185
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6571
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5366
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3836
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2317
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1147
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.