process.start

Process.Start() only works when line is misread

强颜欢笑 提交于 2019-12-12 02:24:00
问题 I have an Arduino sending a character 'c' through COM port 3. I have a VS2013 C# console application listening on COM3 for character 'c' . The if statement when 'c' is read launches a .ahk file. The problem is that when I build and install my application on another computer the file will only be opened if the line is written incorrectly on the console. I noticed this after several attempts. So as to say, when data is received console prints a new line "data received" , and a second line with

Launching Web Browser from Windows Service

你说的曾经没有我的故事 提交于 2019-12-11 09:20:03
问题 Is it possible to launch a web browser from a windows service? I have created a basic service in C# and installed it under the "LocalSystem" security profile. The code for the service looks as follows: namespace Bootloader { public partial class Service1 : ServiceBase { public Service1() { InitializeComponent(); } protected override void OnStart(string[] args) { string target = "http://www.microsoft.com"; System.Diagnostics.Process.Start(target); } protected override void OnStop() { } } }

Process.Start() not spawning new process under the same user

你。 提交于 2019-12-11 07:25:18
问题 I was always under the impression that when you're running a process as (domain\user) mydomain\myuser , when using Process.Start() it would start this new process using the same credentials - mydomain\myuser . The issue I'm having is that my Process.Start() call seems to be creating a process under the SYSTEM account which is causing me permission issues in the started process (which must run under an admin account due to the work it does). If it changes things - I'm spawning this process (a

How to run .exe from C#

拟墨画扇 提交于 2019-12-11 05:19:27
问题 I am developing wpf application in C#. I am using grib files in my application. I want to convert this grib file content into csv file. From command prompt I can easily do this. For this in command prompt I need to go to the folder location of degrib.exe i.e. c:\ndfd\degrib\bin. For any other path command will not get executed. I am using the following commands C:\ndfd\degrib\bin\degrib D:\Documents\Pacificwind.grb -C -msg 1 -Csv C:\ndfd\degrib\bin\degrib D:\Documents\Pacificwind.grb -C -msg

Process.Start cmd.exe won't run cmd file that is passed as agument when running in IIS

你离开我真会死。 提交于 2019-12-11 03:12:39
问题 I've been searching and experimenting all morning with this one and I'm stumped. I have an aspx page running in IIS and calling the following c# function. I'm trying to have it run a cmd file and return the output from the cmd file. I've experimented with the five different options in the code below: protected String RunMyCmdFileAndGetResponse() { Process proc = new Process (); proc.StartInfo.FileName = @"c:\Windows\System32\cmd.exe"; // proc.StartInfo.Arguments = @"/c echo hello"; <== 1 //

Is it possible to open regedit and navigate to straight to a specific key using process.start?

有些话、适合烂在心里 提交于 2019-12-11 01:34:34
问题 I'm making a small tool that can write a key in registry, and a tiny part of it just for convenience would be to navigate to that key instantly with the click of a button. I know how to open regedit.exe already but is there a way to instantly navigate to the key i need? I'm trying with System.Diagnostics.Process.Start("regedit.exe" + "c/ HKEY_LOCAL_MACHINE"); but i think it's just trying to write a key into registry. Thanks in advance! Edit: @Arran -Actually the tool is for myself mainly. I'm

How to shut down from C#, Process.Start(“shutdown”) not working in Windows XP

六眼飞鱼酱① 提交于 2019-12-10 19:23:27
问题 After some poking around on how to reset my computer and or shut it down from C# I found this explanation on how to do that: ManagementBaseObject outParameters = null; ManagementClass sysOS = new ManagementClass("Win32_OperatingSystem"); sysOS.Get(); // Enables required security privilege. sysOS.Scope.Options.EnablePrivileges = true; // Get our in parameters ManagementBaseObject inParameters = sysOS.GetMethodParameters("Win32Shutdown"); // Pass the flag of 0 = System Shutdown inParameters[

C# cannot find file specified

岁酱吖の 提交于 2019-12-10 18:13:57
问题 Hi I am trying to create a app that uses the msg.exe to send messages over a network. When i execute msg from cmd everything works fine, but when i open cmd with the form i am unable to, went to the system32 folder with cmd and the file is not shown there, but when i browse or use cmd normally it is and evrything works tested it on another computer and app works fine, running win 7 64 bit on this 1. Here is a code sample that i use to open cmd: Process.Start("cmd"); i am running as admin i

Process.Start() not starting the .exe file (works when run manually)

♀尐吖头ヾ 提交于 2019-12-09 14:57:59
问题 I have an .exe file that needs to be run after I create a file. The file is successfully created and I am using the following code to run the .exe file after that: ProcessStartInfo processInfo = new ProcessStartInfo(); processInfo.FileName = pathToMyExe; processInfo.ErrorDialog = true; processInfo.UseShellExecute = false; processInfo.RedirectStandardOutput = true; processInfo.RedirectStandardError = true; Process proc = Process.Start(processInfo); I also tried with a simple Process.Start

Redirecting C++ console output to C#

六月ゝ 毕业季﹏ 提交于 2019-12-08 13:01:55
问题 I'm trying to get the output of the C++ console to the C# Windows Form application, the problem I'm having is the output of the C++ exe is displayed in the C# console only after the C++ exe is terminated. Is there anyway to get the exe output to C# console in real time while running the C++ exe (as in without having to terminate the exe)? Here is how I tried, Process p = new Process(); p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.FileName = "C:\