Questions tagged [processstartinfo]

269 questions
8
votes
2 answers

Starting a process with a user name and password

I know that you can run a process with a given username/password in the following way: var processInfo = new ProcessStartInfo { WorkingDirectory = workingDirectory, FileName = "a name", UserName = loggedUserName, Password =…
CodeMonkey
  • 11,196
  • 30
  • 112
  • 203
8
votes
1 answer

Execute script using sysinternals PSExec from Asp.Net Web application

I am trying to execute PSExec from my Asp.Net Web application to connect to a remote server. Somehow it gives "Access Denied Error -5" with no credentials set, and by setting the credentials in the PSEXEC command it gives "2250 Network connection…
PSL
  • 123,204
  • 21
  • 253
  • 243
7
votes
2 answers

Interact with ffmpeg from a .NET program?

I'm trying to create a .NET wrapper for media-file conversion using ffmepg, here is what I've tried: static void Main(string[] args) { if (File.Exists("sample.mp3")) File.Delete("sample.mp3"); string result; using (Process p = new…
Shimmy Weitzhandler
  • 101,809
  • 122
  • 424
  • 632
7
votes
1 answer

Running Python script from Azure WebJob

I'm trying to run python script from Azure webjob. This is what I've done following this link Access the kudu tool via the url https://.scm.azurewebsites.net and installed Python 364x86 via Site Extensions tab Confirmed Python 364x86…
bbusdriver
  • 1,577
  • 3
  • 26
  • 58
7
votes
2 answers

Process.Start Permissions Problem

I'm trying to run an external problem from C# by using Process.Start, but am running into permissions issues. When I open a command prompt normally (not as an admin) and run my commands they work fine, but when I open a command prompt via…
Shane Fulmer
  • 7,510
  • 6
  • 35
  • 43
7
votes
2 answers

Get List of available Verbs (file association) to use with ProcessStartInfo in c#

I am trying to open and print files with the ProcessStartInfo class. (File can be anything but let`s assume it is a PDF File) ProcessStartInfo pi = new ProcessStartInfo(file); pi.Arguments = Path.GetFileName(file); pi.WorkingDirectory =…
Marc Wittmann
  • 2,286
  • 2
  • 28
  • 41
7
votes
2 answers

How to launch a process with sudo by ProcessStartInfo?

I have a program in Debian which needs root privileges and myuser has to run it, but I have to do the call from a .NET application (C#) running in mono. In /etc/sudoers, I have add the line: myuser ALL = NOPASSWD: /myprogram so sudo ./myprogram…
Mon
  • 131
  • 2
  • 4
7
votes
3 answers

How can one specify the window title for a console application started with System.Diagnostics.Process.Start()?

I am starting a new instance of a console application from my .NET code using the Process.Start() method. I was wondering if I can specify the title of the console window hosting the spawned process. Could not find anything suitable in…
mark
  • 59,016
  • 79
  • 296
  • 580
6
votes
2 answers

What's the difference between "print" and "printo" verbs when starting a process?

I suspect this may apply to multiple programming languages, but in this context I am referring to .NET. When I use System.Diagnostics.Process.Start, I can include, as an argument, a System.Diagnostics.ProcessStartInfo object. One of the properties…
Sonny Boy
  • 7,848
  • 18
  • 76
  • 104
6
votes
1 answer

ProcessStartInfo and Process in PowerShell - Authentication Error

I have code that uses ProcessStartInfo and Process to invoke another script, and to return the output of that script. Unfortunately, I am getting errors, and I am unsure how to troubleshoot them. #script1.ps1 $abc = $args $startInfo =…
Glowie
  • 2,271
  • 21
  • 60
  • 104
5
votes
1 answer

Process.start does not find file when useshellexecute = false

I need to call batch-files from my UWP Application. The way to do seems to be Process.Start(), but it says it does not find the file even tough it is definitly there when I follow the path it outputs. Filepath and Working Directory are both given…
Mika
  • 75
  • 5
4
votes
5 answers

Process.Start filename using %temp%

For some odd reaseon this code fails: p.StartInfo.FileName = @"%temp%\SSCERuntime_x86-ENU.msi"; and this code succes: p.StartInfo.FileName = @"C:\Users\USERNAME\AppData\Local\Temp\SSCERuntime_x86-ENU.msi"; Is there any reason I am missing? Note I…
Diego
  • 16,436
  • 26
  • 84
  • 136
4
votes
1 answer

Process of Shutdown.exe with multiple arguments, not working

I want to create a process which uses shutdown.exe to shut down the computer after a given time. Here is my code: ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.CreateNoWindow = false; startInfo.UseShellExecute =…
Toby
  • 95
  • 1
  • 10
4
votes
2 answers

How to pass WindowState from desktop shortcut into WPF app?

How can I control the initial WindowState (Normal, Minimized, Maximized) of a WPF main window from a desktop shortcut? The "Run:" combobox of the shortcut's properties dialog let's me choose between "Normal window", "Minimized" and "Maximized". But…
candritzky
  • 123
  • 1
  • 5
4
votes
4 answers

Program doesn’t terminate when using processes

Using the ProcessStartInfo and Process I would like start a program (e g getdiff.exe) and then read all the output that program produces. Later I will use the data in a more constructive way put right now I just want to print the data to ensure it…
Teletha
  • 603
  • 1
  • 11
  • 21
1
2
3
17 18