process.start

Process.Start never returns when UAC denied

空扰寡人 提交于 2020-05-25 11:27:51
问题 I have an updater exe that is meant to close the primary exe, replace it with an updated exe, and then launch that updated exe. When the updater attempts to start the updated exe, if the UAC permissions dialog is denied by the user, the updater will hang. This is because the Process.Start() function never returns. My CPU cycles meter indicates practically no usage btw. I would hope all my users just say "yes" to the UAC, but since I'm here I'd like to handle this case with some kind of error

ASP.NET Process.Start not working on IIS8 (Windows 8.1)

拜拜、爱过 提交于 2020-02-08 08:51:13
问题 I've been trying to get this working for the past couple of days and tried every solution suggested including the one here: System.Diagnostics.Process.Start not work from an IIS This code (ASP.NET MVC Web Application) works perfectly on IIS7 (Windows 7). The code just print a PDF file using Adobe Reader in a local printer (intranet) from the server: // print receipt ProcessStartInfo psInfo = new ProcessStartInfo(); psInfo.FileName = acrobatReaderPath; psInfo.WorkingDirectory = System.IO.Path

How do I ensure C#'s Process.Start will expand environment variables?

泪湿孤枕 提交于 2020-01-24 02:25:28
问题 I'm attempting to create a process like so: var psi = new ProcessStartInfo { FileName = @"%red_root%\bin\texturepreviewer.exe", UseShellExecute = true }; var process = Process.Start(psi); process.WaitForExit(); Now the environment variable "red_root" definitely exists in the spawned process' environment variables, but the execute doesn't seem to expand the environment variable and so the file isn't found. How can I get the Process.Start to expand the environment variable in the file name? 回答1

How do you open a local html file in a web browser when the path contains an url fragment

巧了我就是萌 提交于 2020-01-23 12:53:02
问题 I am trying to open a web browser via the following methods. However, when the browser opens the url / file path, the fragment piece gets mangled (from "#anchorName" to "%23anchorName") which does not seem to get processed. So basically, the file opens but does not jump to the appropriate location in the document. Does anyone know how to open the file and have the fragment processed? Any help on this would be greatly appreciated. an example path to open would be "c:\MyFile.Html#middle" //

Process Start as domain administrator from user started process with UAC activated in domain network

拜拜、爱过 提交于 2020-01-15 03:07:54
问题 I am trying to do something that, now after much banging my head against the screen, am not sure it can be done. The scenario is as follows: a windows network with a domain controller where the normal users of the PC's don't have administrative privileges. A program that, when it finds an update (MSI) in a share of the network (UNC path), will run the update. Because the user cannot do installations. The update must be run with some other user with admin rights. The theory is sound but: it

Process Start as domain administrator from user started process with UAC activated in domain network

杀马特。学长 韩版系。学妹 提交于 2020-01-15 03:06:53
问题 I am trying to do something that, now after much banging my head against the screen, am not sure it can be done. The scenario is as follows: a windows network with a domain controller where the normal users of the PC's don't have administrative privileges. A program that, when it finds an update (MSI) in a share of the network (UNC path), will run the update. Because the user cannot do installations. The update must be run with some other user with admin rights. The theory is sound but: it

run vb script using script.exe

会有一股神秘感。 提交于 2020-01-14 05:14:11
问题 I want to run vbscript file using cscript.exe. i searched a lot but did'nt found any way while i can run my script using cmd with cscript.exe this is my code Process p = new Process(); p.StartInfo.Arguments = @"C:\\Program Files\\VDIWorkLoad\\WorkLoadFile\\open test.vbs"; p.StartInfo.FileName = "testing"; p.StartInfo.UseShellExecute = false; try { p.Start(); p.WaitForExit(); Console.WriteLine("Done."); } any idea how i can use cscript.exe 回答1: You should set the FileName property to the

System.Diagnostics.Process.Start(“http://google.com”) crashes IE

蓝咒 提交于 2020-01-06 16:50:47
问题 Okay I'm having a brain fart here. This should be simple, but I'm missing something. I've got a win form and I'm trying to launch a web page when I click a button. The code for the button is here: private void button2_Click(object sender, EventArgs e) { try { System.Diagnostics.Process.Start("http://www.google.com"); } catch (Win32Exception ex) { Console.WriteLine(ex.Message); lblError.Text = ex.Message; } } When I run this on my computer, it works fine. On other computers, it only works if

Launch SYSPREP in C#

一曲冷凌霜 提交于 2020-01-06 13:03:17
问题 I have found this via stack-overflow search but no one has given a solution that works. I am writing a simple program and the first part of it is to launch sysprep.exe with some arguments. For some reason sysprep does not launch when code is run. It gives an error that file cannot be found. For e.g. by using the code below Notepad will open with no issues. If I try and open sysprep it will not. Process.Start(@"C:\Windows\System32\notepad.exe"); -- opens with no issue Process.Start(@"C:

open .msg file using Process.Start()

假如想象 提交于 2019-12-25 16:54:03
问题 ProcessStartInfo startInfo = new ProcessStartInfo(); Process first = new Process(); startInfo.FileName = "OUTLOOK"; startInfo.Arguments = "http:\\blabla.com\EMAIL.msg"; startInfo.CreateNoWindow = true; first.StartInfo = startInfo; first.Start(); i used Process.Start to start up Outlook and open a .Msg file. how can i reuse the same process to open another .msg file without opening multiple processes/threads/instances of outlook? i have tried something like Process[] outlook = Process