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

Process.start() to call an exe in remote system

P: n/a
kk
hello to all,

I want to call an exe file on other system(on the same LAN)though a
webservice(by placing the dll).For that i use the following code in
C#......

Process ps = new Process();
ps.StartInfo.FileName = exeFilePath
ps.StartInfo.Arguments = arguments;
ps.Start();
ps.WaitForExit();

It calls the exe file that i can see it in TaskManager.But it doesn't
execute.It remains untill i have to kill that process.But in console
application the same code works fine.If the webservice is in the same
system it works properly.If i copy the dll and put it somewhere else i
doesn't work.I think it is a security problem.

I don't want webconfig file....
(There we can put i impersonate = "true")

Can anyone help me on this issue.........

Thanks

Karthik

Nov 21 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Kartik,

Is that exe running under aspnet user name or what???

If that exe may need network access then it might be the case that running
on aspnet user wont give access to the network resource.
"kk" wrote:
hello to all,

I want to call an exe file on other system(on the same LAN)though a
webservice(by placing the dll).For that i use the following code in
C#......

Process ps = new Process();
ps.StartInfo.FileName = exeFilePath
ps.StartInfo.Arguments = arguments;
ps.Start();
ps.WaitForExit();

It calls the exe file that i can see it in TaskManager.But it doesn't
execute.It remains untill i have to kill that process.But in console
application the same code works fine.If the webservice is in the same
system it works properly.If i copy the dll and put it somewhere else i
doesn't work.I think it is a security problem.

I don't want webconfig file....
(There we can put i impersonate = "true")

Can anyone help me on this issue.........

Thanks

Karthik

Nov 21 '05 #2

P: n/a
kk


Gujju

Thanks for your reply .

The exe runs under the userName NETWORK SERVICE.But i want that to be
ADMINISTRATOR.Is there any option to give administrator permission
through Process.Start() method...

Nov 21 '05 #3

P: n/a
So its network service ie windows 2003 server....
As the process.start will invoke and take the parent username...
so either u run the parent as administrator or use api to invoke a process
under a username.

and have a look at this post as well..

http://groups.google.com.au/groups?h...gbl%26rnum%3D1

Hope it helps
Cheers
C

"kk" wrote:


Gujju

Thanks for your reply .

The exe runs under the userName NETWORK SERVICE.But i want that to be
ADMINISTRATOR.Is there any option to give administrator permission
through Process.Start() method...

Nov 21 '05 #4

P: n/a
kk
If i execute the webservice it invoke the exe by its userName as
NETWORK SERVICE.But i need to execute the exe with ADMINISTRATOR
Permission

Gujju wrote:
So its network service ie windows 2003 server....
As the process.start will invoke and take the parent username...
so either u run the parent as administrator or use api to invoke a process
under a username.

and have a look at this post as well..

http://groups.google.com.au/groups?h...gbl%26rnum%3D1

Hope it helps
Cheers
C


Nov 21 '05 #5

P: n/a
KK i know that... it uses Network service as the webservice is going to run
on iis which is running under network service so all the exes which are
invoked within from the web service would be invoked by network service as
the parent(IIS process) is running NETwork Service.

To solve this u need to run the IIS under a specified user (may by admin or
any othew domain user which can access and process your exe)

On windows 2003 you can change the application pool to run under a specified
domain controlled username.

I also need to aware you that dont run IIS under admin. But just create a
domain account which has less previlages and run the whole iis to run under
that username

cheers
C

"kk" wrote:
If i execute the webservice it invoke the exe by its userName as
NETWORK SERVICE.But i need to execute the exe with ADMINISTRATOR
Permission

Gujju wrote:
So its network service ie windows 2003 server....
As the process.start will invoke and take the parent username...
so either u run the parent as administrator or use api to invoke a process
under a username.

and have a look at this post as well..

http://groups.google.com.au/groups?h...gbl%26rnum%3D1

Hope it helps
Cheers
C


Nov 21 '05 #6

P: n/a
kk

Thanks Gujju...........

I already created an application pool.But it shows some server
error.Thats why i don't use application pool.But I put the
coresponding asmx ,dll and webconfig in seperate folder under the
created application pool.Noe its working.Once again thanks for your
guidance...

Regards

karthick.k
Gujju wrote:
KK i know that... it uses Network service as the webservice is going to run
on iis which is running under network service so all the exes which are
invoked within from the web service would be invoked by network service as
the parent(IIS process) is running NETwork Service.

To solve this u need to run the IIS under a specified user (may by admin or
any othew domain user which can access and process your exe)

On windows 2003 you can change the application pool to run under a specified
domain controlled username.

I also need to aware you that dont run IIS under admin. But just create a
domain account which has less previlages and run the whole iis to run under
that username

cheers
C

"kk" wrote:
If i execute the webservice it invoke the exe by its userName as
NETWORK SERVICE.But i need to execute the exe with ADMINISTRATOR
Permission

Gujju wrote:
So its network service ie windows 2003 server....
As the process.start will invoke and take the parent username...
so either u run the parent as administrator or use api to invoke a process
under a username.

and have a look at this post as well..

http://groups.google.com.au/groups?h...gbl%26rnum%3D1

Hope it helps
Cheers
C



Nov 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.