473,387 Members | 1,742 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,387 software developers and data experts.

System.Diagnostic.Process and disfunctional process

I am starting and stopping a process using System.Diagnostic.Process.

aspnet_wp is running as system rather than machine (as per machine.config
modification). When the process gets started, it will not respond to tcp
connections. The process is a service that accepts incoming tcp
connections.

Any ideas will be great.
Nov 18 '05 #1
5 1801
Hi, Michael Johnson Sr.,

I think you will still need to impersonate a user that has rights to
start/stop services on the machine (I'm afraid I can't give you the list of
these rights)

Have a look at the following article (the last section in it):
[ Implementing Impersonation in an ASP.NET Application ]
http://support.microsoft.com/default.aspx?kbid=306158

After doing so, you have 2 ways
- using the System.Diagnostics.Process to call "net.exe" and passing it the
appropriate parameters. It's simpler, but not the better way for sure.
- using platform-invoke - you will have to call the following functions:
http://msdn.microsoft.com/library/en...nscmanager.asp
http://msdn.microsoft.com/library/en...penservice.asp
http://msdn.microsoft.com/library/en...artservice.asp
(optionally, if you need to further control the service, i.e. stop it:)
http://msdn.microsoft.com/library/en...rolservice.asp
http://msdn.microsoft.com/library/en...vicehandle.asp

Hope this helps
Martin
"Michael Johnson Sr." <m.**********@acmewidgets.com> wrote in message
news:e0**************@TK2MSFTNGP09.phx.gbl...
I am starting and stopping a process using System.Diagnostic.Process.

aspnet_wp is running as system rather than machine (as per machine.config
modification). When the process gets started, it will not respond to tcp
connections. The process is a service that accepts incoming tcp
connections.

Any ideas will be great.

Nov 18 '05 #2
Well if I watch task manager, I see the task start/stop.
But it won't respond to connections, it acts like it isn't even running.
"Martin Dechev" <de*******@hotmail.com> wrote in message
news:eI**************@TK2MSFTNGP11.phx.gbl...
Hi, Michael Johnson Sr.,

I think you will still need to impersonate a user that has rights to
start/stop services on the machine (I'm afraid I can't give you the list of these rights)

Have a look at the following article (the last section in it):
[ Implementing Impersonation in an ASP.NET Application ]
http://support.microsoft.com/default.aspx?kbid=306158

After doing so, you have 2 ways
- using the System.Diagnostics.Process to call "net.exe" and passing it the appropriate parameters. It's simpler, but not the better way for sure.
- using platform-invoke - you will have to call the following functions:
http://msdn.microsoft.com/library/en...nscmanager.asp
http://msdn.microsoft.com/library/en...penservice.asp
http://msdn.microsoft.com/library/en...artservice.asp
(optionally, if you need to further control the service, i.e. stop it:)
http://msdn.microsoft.com/library/en...rolservice.asp
http://msdn.microsoft.com/library/en...vicehandle.asp
Hope this helps
Martin
"Michael Johnson Sr." <m.**********@acmewidgets.com> wrote in message
news:e0**************@TK2MSFTNGP09.phx.gbl...
I am starting and stopping a process using System.Diagnostic.Process.

aspnet_wp is running as system rather than machine (as per machine.config modification). When the process gets started, it will not respond to tcp connections. The process is a service that accepts incoming tcp
connections.

Any ideas will be great.


Nov 18 '05 #3
"Michael Johnson Sr." <m.**********@acmewidgets.com> wrote in message
news:OT**************@TK2MSFTNGP10.phx.gbl...
Well if I watch task manager, I see the task start/stop.
But it won't respond to connections, it acts like it isn't even running.


This means that if it runs as SYSTEM it doesn't behave as expected. And on
behalf of which user it runs normally? Can you try to impersonate this user
and then start it?

Apart from that, are you sure that it doesn't expect some user's
interaction? i.e. it might well be "showing" some dialog box which you can't
see, and so the application stays blocked.

Greetings
Martin
Nov 18 '05 #4
I was impersonating an admin (which from what i understand is required for
using system.diagnostics.process.getprocesses().

But I couldn't get it to work on Win2000, although it worked on WinXP. I
could stop the process as the admin but starting it still seemd like it was
system user. On WinXP i didn't even have to set aspnet_wp to be system.
"Martin Dechev" <de*******@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
"Michael Johnson Sr." <m.**********@acmewidgets.com> wrote in message
news:OT**************@TK2MSFTNGP10.phx.gbl...
Well if I watch task manager, I see the task start/stop.
But it won't respond to connections, it acts like it isn't even running.

This means that if it runs as SYSTEM it doesn't behave as expected. And on
behalf of which user it runs normally? Can you try to impersonate this

user and then start it?

Apart from that, are you sure that it doesn't expect some user's
interaction? i.e. it might well be "showing" some dialog box which you can't see, and so the application stays blocked.

Greetings
Martin

Nov 18 '05 #5
When I use identity impersonate username (administrator account)

I can't stop the service created by SYSTEM (aspnet_wp)

When I start the service, it gets started as SYSTEM despite who I
impersonate
"Martin Dechev" <de*******@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
"Michael Johnson Sr." <m.**********@acmewidgets.com> wrote in message
news:OT**************@TK2MSFTNGP10.phx.gbl...
Well if I watch task manager, I see the task start/stop.
But it won't respond to connections, it acts like it isn't even running.

This means that if it runs as SYSTEM it doesn't behave as expected. And on
behalf of which user it runs normally? Can you try to impersonate this

user and then start it?

Apart from that, are you sure that it doesn't expect some user's
interaction? i.e. it might well be "showing" some dialog box which you can't see, and so the application stays blocked.

Greetings
Martin

Nov 18 '05 #6

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

Similar topics

1
by: Alex | last post by:
Hello, in my company, we have a diagnostic tool for hardware. Depending on the hardware projcet, a different project configuration is needed. The configuration file is written in XML and...
0
by: Stefan Turalski \(stic\) | last post by:
Hi, I need help with one thing - I've simple update application, it's chceck with FineInfo class if file in server has last write time > than file on my disc, if yes it is just update my file...
2
by: adish11 | last post by:
I'm using Web Application and want to execute an MSDOS executable with some parameters like this example: software.exe -i -x How do I use System.Diagnostic.Process to execute this .exe with...
0
by: Michael Johnson Sr. | last post by:
I am starting and stopping a process using System.Diagnostic.Process. aspnet_wp is running as system rather than machine (as per machine.config modification). When the process gets started, it...
5
by: Paul Bergson | last post by:
I have been trying to get a process to start up and run with arguments passed to it. I have gotten close (Thanks to help from this board) but I there is a failure while I'm running this because...
3
by: sandro72 | last post by:
I found the classes you wrote of but it doesn't work. i tested also this code but it cretaes instances of worpad.exe that i only see by task manager and i cannot terminate them. have you any...
1
by: brian | last post by:
I have a vb.net app using a shell command because I can't figure out how to use the string with the system.process.start. I would like to convert it so I can do a little error checking to...
6
by: Gunga Din | last post by:
I must be missing it somehow... I need to count the number of threads running, not just those started by my application. Rather like the Task Manager, I would like to get the total number of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...

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.