c# - Can I run another Command Prompt/GUI process in a Windows Service? -
I am writing a service of windows, which sometimes requires the system's IP address to be renewed and IP Conferencing / will renew it. Code is showing like this
process ipconfigProcess = new process (); IpconfigProcess.StartInfo.FileName = "ipconfig"; IpconfigProcess.StartInfo.Arguments = "/ Renewal"; IpconfigProcess.StartInfo.UseShellExecute = false; IpconfigProcess.StartInfo.RedirectStandardOutput = True; IpconfigProcess.Start (); StrOutput = compiler.StandardOutput.ReadToEnd (); IpconfigProcess.WaitForExit (); I think the windows service is not allowed to show windows / dialogue, so my question is whether to upgrade the above IP will be a problem in the Windows service, as the IPCPIP can run Can not I see the console or not?
I think the only problem you are facing is permission - you There should be no problem in running the process (unless you want to interact with any type of UI), but your windows service needs to be run as an account that executes an egg and ipconfig process Will be able to.
Comments
Post a Comment