win7,sc delete, windows servis,process start
-
hi all, I have used win xp an this code runnig normally but when I started to use win7 it is not working what is it my problem thanks.. foreach (ServiceController service in services) { if (service.ServiceName == "SistemServisleri") { string argu = @"/C sc delete SistemServisleri"; System.Diagnostics.Process.Start(@"c:\Windows\system32\cmd.exe", argu);// for win7 I used it but not working System.Diagnostics.Process.Start("cmd", argu);// for winxp I used it and working } }
-
hi all, I have used win xp an this code runnig normally but when I started to use win7 it is not working what is it my problem thanks.. foreach (ServiceController service in services) { if (service.ServiceName == "SistemServisleri") { string argu = @"/C sc delete SistemServisleri"; System.Diagnostics.Process.Start(@"c:\Windows\system32\cmd.exe", argu);// for win7 I used it but not working System.Diagnostics.Process.Start("cmd", argu);// for winxp I used it and working } }
Have you debugged it? Does the service exist? What do you mean it doesn't work? Does it not run? Does it through an exception? Please format any code you post using the pre tags, i.e. the "code block" link in the edit menu.
I know the language. I've read a book. - _Madmatt
-
Have you debugged it? Does the service exist? What do you mean it doesn't work? Does it not run? Does it through an exception? Please format any code you post using the pre tags, i.e. the "code block" link in the edit menu.
I know the language. I've read a book. - _Madmatt
I want to delete this servis with this code but it can't be deleted
-
hi all, I have used win xp an this code runnig normally but when I started to use win7 it is not working what is it my problem thanks.. foreach (ServiceController service in services) { if (service.ServiceName == "SistemServisleri") { string argu = @"/C sc delete SistemServisleri"; System.Diagnostics.Process.Start(@"c:\Windows\system32\cmd.exe", argu);// for win7 I used it but not working System.Diagnostics.Process.Start("cmd", argu);// for winxp I used it and working } }
Is it a UAC (user account control) problem? Even if you are a member of the admin group, you must run that program "as administrator" explicitly.
-
Is it a UAC (user account control) problem? Even if you are a member of the admin group, you must run that program "as administrator" explicitly.
for administrator I use System.Diagnostics.Process.Start(@__"c:\Windows\system32\cmd.exe__", argu);
-
for administrator I use System.Diagnostics.Process.Start(@__"c:\Windows\system32\cmd.exe__", argu);
YOur code has to run as an administrator. Under Vista and 7, even an admin account doesn't run as an admin account until the privilege requires it and you get the UAC box. To get around that UAC box, you have to create a manifest file in your project that specifies the app needs admin level permissions to run. Here's[^] a quick'n'dirty on what you need to do.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
YOur code has to run as an administrator. Under Vista and 7, even an admin account doesn't run as an admin account until the privilege requires it and you get the UAC box. To get around that UAC box, you have to create a manifest file in your project that specifies the app needs admin level permissions to run. Here's[^] a quick'n'dirty on what you need to do.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
The code needs to be running as an admin regardless of how you do it.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak