473,581 Members | 2,785 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Start Process from Web Service

Hi,

Can I start an external process from the Web Service?

I'm using a code, compiler keeps silence, compiles ok and starts the
project. When I trace in Debugger it doesn't start an external process.
That's strange for me. I understand that it should be a new shell, but why I
can't start it? Is it need to have a Windows application to start an
external process? I created a very long batch files and a complicated
script to work with the database using several external utilities, but I
can't call this batch files. How can I do that at all?

private int RunExecutable(s tring sName, string sOption){

Process process = new Process();

process.StartIn fo.FileName = sName;

process.StartIn fo.Arguments = sOption;

try{process.Sta rt();}

catch{return S_Exclusion;}

process.WaitFor Exit();

return process.ExitCod e;

}//

Regards,
Dmitri
Nov 15 '05 #1
6 6834
Catch the exception, man! Probably the process that runs under ASPNET user
don't have rights on the path where your executable file is or some of the
inner tasks performed by the process requires more credentials.

--
Horatiu Ripa

"Dmitri Shvetsov" <ds*******@cox. net> wrote in message
news:rinsb.3574 8$L77.18322@fed 1read03...
Hi,

Can I start an external process from the Web Service?

I'm using a code, compiler keeps silence, compiles ok and starts the
project. When I trace in Debugger it doesn't start an external process.
That's strange for me. I understand that it should be a new shell, but why I can't start it? Is it need to have a Windows application to start an
external process? I created a very long batch files and a complicated
script to work with the database using several external utilities, but I
can't call this batch files. How can I do that at all?

private int RunExecutable(s tring sName, string sOption){

Process process = new Process();

process.StartIn fo.FileName = sName;

process.StartIn fo.Arguments = sOption;

try{process.Sta rt();}

catch{return S_Exclusion;}

process.WaitFor Exit();

return process.ExitCod e;

}//

Regards,
Dmitri

Nov 15 '05 #2
Hi,

Easier. I'm going step-by-step in debugger and it ignores this call, it
steps on and then goes ahead. There is no exception. Usually catch{} shows
the exception, but in this case - nothing. To be sure - the first that I've
done - I excluded the part of code about exception at all. if it was it
would be generated and catch by IDE. Nothing at all.

Probably you're right, we should open these folders for execution, they're
blocked by the system. Maybe it's easier to create a separate process and
catch required parameters from the database and leave the WebService alone.

Thanks.

Dmitri

"Horatiu Ripa" <un****@busines sco.us> wrote in message
news:ur******** ******@tk2msftn gp13.phx.gbl...
Catch the exception, man! Probably the process that runs under ASPNET user
don't have rights on the path where your executable file is or some of the
inner tasks performed by the process requires more credentials.

--
Horatiu Ripa

"Dmitri Shvetsov" <ds*******@cox. net> wrote in message
news:rinsb.3574 8$L77.18322@fed 1read03...
Hi,

Can I start an external process from the Web Service?

I'm using a code, compiler keeps silence, compiles ok and starts the
project. When I trace in Debugger it doesn't start an external process.
That's strange for me. I understand that it should be a new shell, but
why I
can't start it? Is it need to have a Windows application to start an
external process? I created a very long batch files and a complicated
script to work with the database using several external utilities, but I
can't call this batch files. How can I do that at all?

private int RunExecutable(s tring sName, string sOption){

Process process = new Process();

process.StartIn fo.FileName = sName;

process.StartIn fo.Arguments = sOption;

try{process.Sta rt();}

catch{return S_Exclusion;}

process.WaitFor Exit();

return process.ExitCod e;

}//

Regards,
Dmitri


Nov 15 '05 #3
What kind of process are you trying to start? Are you sure it doesn't need an interactive console? Did you run taskman to check the
process is not running?

Willy.

"Dmitri Shvetsov" <ds*******@cox. net> wrote in message news:s_usb.521$ Q64.236@fed1rea d03...
Hi,

Easier. I'm going step-by-step in debugger and it ignores this call, it
steps on and then goes ahead. There is no exception. Usually catch{} shows
the exception, but in this case - nothing. To be sure - the first that I've
done - I excluded the part of code about exception at all. if it was it
would be generated and catch by IDE. Nothing at all.

Probably you're right, we should open these folders for execution, they're
blocked by the system. Maybe it's easier to create a separate process and
catch required parameters from the database and leave the WebService alone.

Thanks.

Dmitri

"Horatiu Ripa" <un****@busines sco.us> wrote in message
news:ur******** ******@tk2msftn gp13.phx.gbl...
Catch the exception, man! Probably the process that runs under ASPNET user
don't have rights on the path where your executable file is or some of the
inner tasks performed by the process requires more credentials.

--
Horatiu Ripa

"Dmitri Shvetsov" <ds*******@cox. net> wrote in message
news:rinsb.3574 8$L77.18322@fed 1read03...
Hi,

Can I start an external process from the Web Service?

I'm using a code, compiler keeps silence, compiles ok and starts the
project. When I trace in Debugger it doesn't start an external process.
That's strange for me. I understand that it should be a new shell, but

why
I
can't start it? Is it need to have a Windows application to start an
external process? I created a very long batch files and a complicated
script to work with the database using several external utilities, but I
can't call this batch files. How can I do that at all?

private int RunExecutable(s tring sName, string sOption){

Process process = new Process();

process.StartIn fo.FileName = sName;

process.StartIn fo.Arguments = sOption;

try{process.Sta rt();}

catch{return S_Exclusion;}

process.WaitFor Exit();

return process.ExitCod e;

}//

Regards,
Dmitri



Nov 15 '05 #4
Hi,

It's just a batch file, I know how it usually runs, it eats a lot of
resources and runs about 15 seconds. So it's easy to understand if it runs
or not. It doesn't. It doesn't require any interface etc. Just a shell to
execute. I start several EXEs from this batch file to create a database, to
run scripts, etc. I decided to create an external application to do all
stuff, but it's interesting to know is it possible at all to start an
external application using Process class?

Dmitri

"Willy Denoyette [MVP]" <wi************ *@pandora.be> wrote in message
news:OG******** ********@TK2MSF TNGP11.phx.gbl. ..
What kind of process are you trying to start? Are you sure it doesn't need an interactive console? Did you run taskman to check the process is not running?

Willy.

"Dmitri Shvetsov" <ds*******@cox. net> wrote in message

news:s_usb.521$ Q64.236@fed1rea d03...
Hi,

Easier. I'm going step-by-step in debugger and it ignores this call, it
steps on and then goes ahead. There is no exception. Usually catch{} shows the exception, but in this case - nothing. To be sure - the first that I've done - I excluded the part of code about exception at all. if it was it
would be generated and catch by IDE. Nothing at all.

Probably you're right, we should open these folders for execution, they're blocked by the system. Maybe it's easier to create a separate process and catch required parameters from the database and leave the WebService alone.
Thanks.

Dmitri

"Horatiu Ripa" <un****@busines sco.us> wrote in message
news:ur******** ******@tk2msftn gp13.phx.gbl...
Catch the exception, man! Probably the process that runs under ASPNET user don't have rights on the path where your executable file is or some of the inner tasks performed by the process requires more credentials.

--
Horatiu Ripa

"Dmitri Shvetsov" <ds*******@cox. net> wrote in message
news:rinsb.3574 8$L77.18322@fed 1read03...
> Hi,
>
> Can I start an external process from the Web Service?
>
> I'm using a code, compiler keeps silence, compiles ok and starts the
> project. When I trace in Debugger it doesn't start an external process. > That's strange for me. I understand that it should be a new shell, but
why
I
> can't start it? Is it need to have a Windows application to start an
> external process? I created a very long batch files and a

complicated > script to work with the database using several external utilities, but I > can't call this batch files. How can I do that at all?
>
> private int RunExecutable(s tring sName, string sOption){
>
> Process process = new Process();
>
> process.StartIn fo.FileName = sName;
>
> process.StartIn fo.Arguments = sOption;
>
> try{process.Sta rt();}
>
> catch{return S_Exclusion;}
>
> process.WaitFor Exit();
>
> return process.ExitCod e;
>
> }//
>
> Regards,
> Dmitri
>
>



Nov 15 '05 #5
You can easily check if the process does not execute due to a lack of
credentials by putting the ASPNET user in Administrators group. Check this
out and if everything works that this is the issue arount this behaviour.

--
Horatiu Ripa

"Dmitri Shvetsov" <ds*******@cox. net> wrote in message
news:0cysb.933$ Q64.207@fed1rea d03...
Hi,

It's just a batch file, I know how it usually runs, it eats a lot of
resources and runs about 15 seconds. So it's easy to understand if it runs
or not. It doesn't. It doesn't require any interface etc. Just a shell to
execute. I start several EXEs from this batch file to create a database, to run scripts, etc. I decided to create an external application to do all
stuff, but it's interesting to know is it possible at all to start an
external application using Process class?

Dmitri

"Willy Denoyette [MVP]" <wi************ *@pandora.be> wrote in message
news:OG******** ********@TK2MSF TNGP11.phx.gbl. ..
What kind of process are you trying to start? Are you sure it doesn't need
an interactive console? Did you run taskman to check the
process is not running?

Willy.

"Dmitri Shvetsov" <ds*******@cox. net> wrote in message news:s_usb.521$ Q64.236@fed1rea d03... Hi,

Easier. I'm going step-by-step in debugger and it ignores this call, it steps on and then goes ahead. There is no exception. Usually catch{} shows the exception, but in this case - nothing. To be sure - the first that I've done - I excluded the part of code about exception at all. if it was it would be generated and catch by IDE. Nothing at all.

Probably you're right, we should open these folders for execution, they're blocked by the system. Maybe it's easier to create a separate process and catch required parameters from the database and leave the WebService alone.
Thanks.

Dmitri

"Horatiu Ripa" <un****@busines sco.us> wrote in message
news:ur******** ******@tk2msftn gp13.phx.gbl...
> Catch the exception, man! Probably the process that runs under ASPNET user
> don't have rights on the path where your executable file is or some
of
the > inner tasks performed by the process requires more credentials.
>
> --
> Horatiu Ripa
>
> "Dmitri Shvetsov" <ds*******@cox. net> wrote in message
> news:rinsb.3574 8$L77.18322@fed 1read03...
> > Hi,
> >
> > Can I start an external process from the Web Service?
> >
> > I'm using a code, compiler keeps silence, compiles ok and starts
the > > project. When I trace in Debugger it doesn't start an external

process. > > That's strange for me. I understand that it should be a new shell, but why
> I
> > can't start it? Is it need to have a Windows application to start an > > external process? I created a very long batch files and a complicated > > script to work with the database using several external utilities, but I > > can't call this batch files. How can I do that at all?
> >
> > private int RunExecutable(s tring sName, string sOption){
> >
> > Process process = new Process();
> >
> > process.StartIn fo.FileName = sName;
> >
> > process.StartIn fo.Arguments = sOption;
> >
> > try{process.Sta rt();}
> >
> > catch{return S_Exclusion;}
> >
> > process.WaitFor Exit();
> >
> > return process.ExitCod e;
> >
> > }//
> >
> > Regards,
> > Dmitri
> >
> >
>
>



Nov 15 '05 #6
Hi,

It could be a security hole. I have already created a separate process that
is running in a background and checks from time to time a database table. It
does all job if it need to be done, then waits for another query. It's safer
anyway, than to run a separate process from a web service.

Regards,

Dmitri

"Horatiu Ripa" <un****@busines sco.us> wrote in message
news:ef******** ******@TK2MSFTN GP10.phx.gbl...
You can easily check if the process does not execute due to a lack of
credentials by putting the ASPNET user in Administrators group. Check this
out and if everything works that this is the issue arount this behaviour.

--
Horatiu Ripa

"Dmitri Shvetsov" <ds*******@cox. net> wrote in message
news:0cysb.933$ Q64.207@fed1rea d03...
Hi,

It's just a batch file, I know how it usually runs, it eats a lot of
resources and runs about 15 seconds. So it's easy to understand if it runs
or not. It doesn't. It doesn't require any interface etc. Just a shell to execute. I start several EXEs from this batch file to create a database, to
run scripts, etc. I decided to create an external application to do all
stuff, but it's interesting to know is it possible at all to start an
external application using Process class?

Dmitri

"Willy Denoyette [MVP]" <wi************ *@pandora.be> wrote in message
news:OG******** ********@TK2MSF TNGP11.phx.gbl. ..
What kind of process are you trying to start? Are you sure it doesn't need
an interactive console? Did you run taskman to check the
process is not running?

Willy.

"Dmitri Shvetsov" <ds*******@cox. net> wrote in message

news:s_usb.521$ Q64.236@fed1rea d03...
> Hi,
>
> Easier. I'm going step-by-step in debugger and it ignores this call,

it > steps on and then goes ahead. There is no exception. Usually catch{}

shows
> the exception, but in this case - nothing. To be sure - the first
that I've
> done - I excluded the part of code about exception at all. if it was it > would be generated and catch by IDE. Nothing at all.
>
> Probably you're right, we should open these folders for execution,

they're
> blocked by the system. Maybe it's easier to create a separate
process and
> catch required parameters from the database and leave the WebService

alone.
>
> Thanks.
>
> Dmitri
>
> "Horatiu Ripa" <un****@busines sco.us> wrote in message
> news:ur******** ******@tk2msftn gp13.phx.gbl...
> > Catch the exception, man! Probably the process that runs under ASPNET
user
> > don't have rights on the path where your executable file is or

some of
the
> > inner tasks performed by the process requires more credentials.
> >
> > --
> > Horatiu Ripa
> >
> > "Dmitri Shvetsov" <ds*******@cox. net> wrote in message
> > news:rinsb.3574 8$L77.18322@fed 1read03...
> > > Hi,
> > >
> > > Can I start an external process from the Web Service?
> > >
> > > I'm using a code, compiler keeps silence, compiles ok and starts
the > > > project. When I trace in Debugger it doesn't start an external

process.
> > > That's strange for me. I understand that it should be a new
shell, but
> why
> > I
> > > can't start it? Is it need to have a Windows application to
start an > > > external process? I created a very long batch files and a

complicated
> > > script to work with the database using several external

utilities, but I
> > > can't call this batch files. How can I do that at all?
> > >
> > > private int RunExecutable(s tring sName, string sOption){
> > >
> > > Process process = new Process();
> > >
> > > process.StartIn fo.FileName = sName;
> > >
> > > process.StartIn fo.Arguments = sOption;
> > >
> > > try{process.Sta rt();}
> > >
> > > catch{return S_Exclusion;}
> > >
> > > process.WaitFor Exit();
> > >
> > > return process.ExitCod e;
> > >
> > > }//
> > >
> > > Regards,
> > > Dmitri
> > >
> > >
> >
> >
>
>



Nov 15 '05 #7

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

Similar topics

8
1820
by: Russ Green | last post by:
I'm using a Setup Project in VB.NET 2003 Standard to install a windows service application. I would like this installer to start the service after install. How do I do that? Thanks, Russ
4
14192
by: Yiu | last post by:
upgent help i want to start IE explorer using C# i try many code such as below: ProcessStartInfo startInfo = new ProcessStartInfo("IEXPLORE.EXE"); Process.Start(startInfo); or Process process = new Process(); process.StartInfo.FileName = "C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE";
4
2238
by: Jeff | last post by:
Hi - I'm building a VB.NET Windows application with an MSDE database. Anticipating the possibility that the MSDE service may have been stopped outside of my app, I'm trying to code a way to start it when my app is launched. I can't seem to get the code to wait for MSDE to start before continuing (the next step is opening a connection). My...
7
7219
by: shai | last post by:
I am working at .net 1.1, writing in c#. I have windows service with a COM object. Every unexpected time The COM object throw an error that make my service get stuck (do not respond). I can catch this error. I want to restart my windows service every time the COM object throws an error. I use System.ServiceProcess.ServiceController to...
4
2897
by: Jianwei Sun | last post by:
Hi, all, I have a question, and I hope to get some hints here.. I created a really simple service just to check why the service manager doesn't start my service the second time if the first time failed.. I created an atl service through the wizard, and the only thing I do is override the PreMessageLoop()...
0
1109
by: James M. | last post by:
I have a Win 2ksp4 Server which I need to get a service started with a different login account other than the "Local System account". The service starts just fine with the "local system account", but once I switch it to "This Account" and type in a user account and password, hit apply, then try to start the service I get the following error....
2
1707
by: softwaresudhir | last post by:
Hello, How to create/install & start windows service? Thanks sharwan
0
946
by: greg chu | last post by:
Hi, I wrote a service program and after msi is installed it does not automatically start the service. Do I have a way to add a custom action to start the service after msi is installed? Thanks. Greg
0
1407
by: nethajireddy | last post by:
Hi, I want to start fax service, when i click "start" its showing..this error "The Fax service on "computer name" started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service." what i have to do... thanks in advance... ...
2
2019
by: Mika M | last post by:
I'm doing Windows Service programming using C# 2005. My solution contains Windows Service project. Then I added Setup and Deployment project into the same solution. Both service- and Setup and Deployment project are working fine. After running setup, it made files into the C:\Program Files\MyCompany\MyService, but how can I install service...
0
7876
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
7804
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...
0
8310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7910
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
8180
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...
1
5681
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
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
3832
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1409
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.