Process. start is not working in Windows 7
I have C# code to start an application using the below code. RunApp() { WindowsPrincipal principal = new WindowsPrincipal(WindowsIdentity.GetCurrent()); bool hasAdminRight = principal.IsInRole(WindowsBuiltInRole.Administrator); if (!hasAdminRight) { filename= Assembly.GetExecutingAssembly().Location; ProcessStartInfo processInfo = new ProcessStartInfo(); processInfo.Verb = "runas"; processInfo.WorkingDirectory = System.IO.Path.GetTempPath(); processInfo.UseShellExecute = true; processInfo.FileName = fileName; try { Process.Start(processInfo); } catch (Win32Exception) {} Shutdown(); } } This code calls the exe itself if the user doesnt have the admin privilege. This code works in Windows XP. But it wont work in Windows 7. If I run this application in Windows 7, nothing will happen but more than one exe name displays in the task manager. The runas Window, which asks for the user name and password, wont display. But it is displaying in Windows XP. If I provide the admin user name and password with the above code with UseShellExecute=false, my application will execute with the given user name and password. How can I run the process without passing the user name and password from my application?
June 22nd, 2012 3:09am

I would recommend to place your problem into MSDN forum http://social.msdn.microsoft.com/Forums/en-US/categories Regards Milos
Free Windows Admin Tool Kit Click here and download it now
June 22nd, 2012 2:42pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics