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

Start Process from Web Service

P: n/a
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(string sName, string sOption){

Process process = new Process();

process.StartInfo.FileName = sName;

process.StartInfo.Arguments = sOption;

try{process.Start();}

catch{return S_Exclusion;}

process.WaitForExit();

return process.ExitCode;

}//

Regards,
Dmitri
Nov 15 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
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.35748$L77.18322@fed1read03...
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(string sName, string sOption){

Process process = new Process();

process.StartInfo.FileName = sName;

process.StartInfo.Arguments = sOption;

try{process.Start();}

catch{return S_Exclusion;}

process.WaitForExit();

return process.ExitCode;

}//

Regards,
Dmitri

Nov 15 '05 #2

P: n/a
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****@businessco.us> wrote in message
news:ur**************@tk2msftngp13.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.35748$L77.18322@fed1read03...
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(string sName, string sOption){

Process process = new Process();

process.StartInfo.FileName = sName;

process.StartInfo.Arguments = sOption;

try{process.Start();}

catch{return S_Exclusion;}

process.WaitForExit();

return process.ExitCode;

}//

Regards,
Dmitri


Nov 15 '05 #3

P: n/a
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@fed1read03...
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****@businessco.us> wrote in message
news:ur**************@tk2msftngp13.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.35748$L77.18322@fed1read03...
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(string sName, string sOption){

Process process = new Process();

process.StartInfo.FileName = sName;

process.StartInfo.Arguments = sOption;

try{process.Start();}

catch{return S_Exclusion;}

process.WaitForExit();

return process.ExitCode;

}//

Regards,
Dmitri



Nov 15 '05 #4

P: n/a
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****************@TK2MSFTNGP11.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@fed1read03...
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****@businessco.us> wrote in message
news:ur**************@tk2msftngp13.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.35748$L77.18322@fed1read03...
> 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(string sName, string sOption){
>
> Process process = new Process();
>
> process.StartInfo.FileName = sName;
>
> process.StartInfo.Arguments = sOption;
>
> try{process.Start();}
>
> catch{return S_Exclusion;}
>
> process.WaitForExit();
>
> return process.ExitCode;
>
> }//
>
> Regards,
> Dmitri
>
>



Nov 15 '05 #5

P: n/a
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@fed1read03...
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****************@TK2MSFTNGP11.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@fed1read03... 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****@businessco.us> wrote in message
news:ur**************@tk2msftngp13.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.35748$L77.18322@fed1read03...
> > 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(string sName, string sOption){
> >
> > Process process = new Process();
> >
> > process.StartInfo.FileName = sName;
> >
> > process.StartInfo.Arguments = sOption;
> >
> > try{process.Start();}
> >
> > catch{return S_Exclusion;}
> >
> > process.WaitForExit();
> >
> > return process.ExitCode;
> >
> > }//
> >
> > Regards,
> > Dmitri
> >
> >
>
>



Nov 15 '05 #6

P: n/a
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****@businessco.us> wrote in message
news:ef**************@TK2MSFTNGP10.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@fed1read03...
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****************@TK2MSFTNGP11.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@fed1read03...
> 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****@businessco.us> wrote in message
> news:ur**************@tk2msftngp13.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.35748$L77.18322@fed1read03...
> > > 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(string sName, string sOption){
> > >
> > > Process process = new Process();
> > >
> > > process.StartInfo.FileName = sName;
> > >
> > > process.StartInfo.Arguments = sOption;
> > >
> > > try{process.Start();}
> > >
> > > catch{return S_Exclusion;}
> > >
> > > process.WaitForExit();
> > >
> > > return process.ExitCode;
> > >
> > > }//
> > >
> > > Regards,
> > > Dmitri
> > >
> > >
> >
> >
>
>



Nov 15 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.