Questions tagged [processstartinfo]

269 questions
1
vote
3 answers

C# Open File With Associated Application passing arguments

I am trying to launch the default application registered for an extension specifying an additional argument: ProcessStartInfo p = new ProcessStartInfo(); p.Arguments = "myargument"; p.FileName = "file.ext"; Process.Start(p); The application…
Paull
  • 1,020
  • 1
  • 12
  • 21
1
vote
0 answers

REG SAVE HKLM\SOFTWARE give me different file size when running from ProcessStartInfo

I'm trying to save the Hive Registry File called HKLM\SOFTWARE from a C# application. When I run the the following command (from CMD) REG SAVE HKLM\SOFTWARE C:\TEST it give me a file with a size of about 90MB. So, I expected that by running this…
Liuk
  • 111
  • 7
1
vote
2 answers

Double quotes in arguments are ignored by ProcessStartInfo

The following command works when entered in cmd : "C:\Program Files\Scripts_Talend\SynchroExo_run.bat" --context_param FileCode=ABCD --context_param FilePath="//networkname/Folder/file.xls" --context_param ReportFilePath="" But it doesn't work when…
thi
  • 71
  • 1
  • 9
1
vote
1 answer

Passing quoted and unquoted arguments to ProcessStartInfo

I'm trying to turn a .lnk file and its arguments into a programmatically executed process using ProcessStartInfo. The .lnk file looks like this: Target: E:\Apps\RunAsDate\RunAsDate.exe 30\10\2017 00:00:00 "D:\MyTest\test.exe" Execute…
tmighty
  • 10,734
  • 21
  • 104
  • 218
1
vote
0 answers

C#: how to run an app as admin without UAC prompt

I know this question was asked before over and over, but I couldn´t find a solution that worked for me. my application needs to do some modification in the program files folders. It starts as a regular user. I found out that adding the app.manifest…
Adriano_Pinaffo
  • 1,429
  • 4
  • 23
  • 46
1
vote
2 answers

Identify crash of executable run by C# Process.Start()

My code: ProcessInfo processInfo = ... Process proc = Process.Start(processInfo); proc.WaitForExit(); if (proc.ExitCode != 0) { // ... } My problem is that the process (a C++ executable) is sometime crashing due to unhandled exceptions, in…
Mugen
  • 8,301
  • 10
  • 62
  • 140
1
vote
2 answers

C# Problem with ProcessStartInfo

I am using a ProcessStartInfo to patch a file with a text file like this (through cmd.exe): app.exe temp.txt patch.ips I wrote this code: ProcessStartInfo P = new ProcessStartInfo("app.exe"); P.Arguments = "temp.txt " + _patchpath; …
david
  • 357
  • 2
  • 7
  • 18
1
vote
0 answers

How to execute piped command using ProcessStartInfo API in windows?

I need to execute the following command in Visual Studio: dsquery group -name "groupname" |dsget group -members This works fine in command prompt, but doesn't give any output in Visual Studio. I am using following code snippet. private void…
1
vote
1 answer

How to know that an automated regsvr32 doesn't work

Following is my code: private static bool Register(string fullFileName, string username, SecureString password) { var isRegistered = false; using (var process = new Process()) { var startInfo =…
ehh
  • 3,412
  • 7
  • 43
  • 91
1
vote
0 answers

Get output for system reboot check from Process when UseShellExecute = true

I am trying to install an instance to SQL using the following code: Process p = new Process(); p.StartInfo = new ProcessStartInfo(@"D:\Softwares\SQL Server 2014\SQLEXPRADV_x64_ENU\SETUP", @"/q /ACTION=Install /IAcceptSQLServerLicenseTerms=True…
Awais Mahmood
  • 1,308
  • 4
  • 21
  • 51
1
vote
1 answer

Executing command in command prompt with redirection on a C# .aspx page

I'm attempting to execute a command in command prompt in C# code on a .aspx page. The code doesn't throw any errors, however, the command doesn't execute because a new file isn't generated. I don't see any issues with the command itself because if…
Bhav
  • 1,957
  • 7
  • 33
  • 66
1
vote
2 answers

How to use Arguments in ProcessStartInfo()

I am trying to code the following to run a python script in c# :- ProcessStartInfo startinfo = new ProcessStartInfo(); startinfo.FileName = @"C:\Program Files (x86)\PuTTY\plink.exe"; startinfo.Arguments = "-ssh username@lpl250srd01 -pw pass…
1
vote
1 answer

Get command line output in real time not working for all cli

The below code is working fine for ping stackoverflow.com and most other cases but when I using 7z.exe it's not real time, it waits until directory is compressed and then shows the output. The argument that I used for compress is a test.7z dirpath.…
Almis
  • 3,684
  • 2
  • 28
  • 58
1
vote
1 answer

Calling ProcessStartInfo with a path with spaces always breaks

I'm calling a command line program with the following configuration: var processStartInfo = new ProcessStartInfo { FileName = mainCommand, UseShellExecute = false, RedirectStandardOutput = true, RedirectStandardError = true, …
Maurício Linhares
  • 39,901
  • 14
  • 121
  • 158
1
vote
1 answer

input from console application to another c# console application?

I want to develop a c# application (a.exe) that input to another c# application (b.exe) b.exe does not take any arguments. b.exe -call or b.exe call and so on does not work When I open b.exe from cmd it take arguments like this: b:call b:command…
david
  • 23
  • 3