Execute Exe With Parameters

Active2 years, 11 months ago
  1. Execute Exe With Parameters Free
  2. Execute Exe With Parameters Cmd

My goal was to use an application that executes a script together with parameter to start an installation. This is how to execute powershell.exe properly using command prompt. What I tried to do. I wanted to run Powershell.exe from the command line and supply it with arguments, a file and parameters. First I was trying to use something like this. My end game is to wrap this in invoke-command, to feed a list of PCs, and run the exe on all of them. For now, i'm just trying to run an exe with parameters from powershell. I can run it from a command line and from a scheduled task. But not from powershell. The argument list has a bunch of quotes and backslashes in it. By substituting ShowArgs.exe for the program you're trying to run (keeping your program's parameters), you can see the actual command-line parameters that PowerShell will use. The ShowArgs.exe program and its source code are available for download by clicking the Download the Code button near the top of the page.

I need to create a script that runs setup.exe /configure Install.xml from the folder the script is located.

When I run the script below, it does find the setup.exe but it does not read the parameters. It is like the last part (/configure Install.xml) is not being read.

Script:

Ansgar WiechersExecute Exe With Parameters
156k15 gold badges147 silver badges208 bronze badges
Emil SkibstedEmil Skibsted

2 Answers

Most likely your code doesn't find and run the setup.exe in the script folder, but a different setup.exe somewhere in the %PATH%.

Simply appending the folder to the commandline is not going to do what you want. There are two ways for you to solve this issue:

  • Run setup.exe with the full path, as suggested by @AlexK. You probably need to provide the full path to Install.xml too. Use the BuildPath method for constructing the paths. You may also want to add quotes around the paths to take care of spaces in them.

  • Change the working directory to the folder containing your script and setup.exe and run the command without path (or the relative path .setup.exe).

Community
Ansgar WiechersAnsgar Wiechers
156k15 gold badges147 silver badges208 bronze badges

Thanks guys! I mixed it up and made this that works for me. (Not sure if something could be made cleaner, but it works!)

Emil SkibstedEmil Skibsted

Not the answer you're looking for? Browse other questions tagged vbscriptparameters or ask your own question.

Active3 years, 11 months ago

Windows media player 12 skins download. I need help in trying to execute an executable from my C# application.
Suppose the path is cPath, the EXE is HHTCtrlp.exe and the parameter that has to be passed is cParams.

How would I go about this?

Execute

The reason why the path is a variable is that there are 3 different EXE files to run and the path will change depending on which one will run, same with the parameter string.

Major. The sims hacked apk. MajorReaping. Major.

Execute

Any help would be greatly appreciated.

Sai Avinash
3,45515 gold badges46 silver badges85 bronze badges
PriveshPrivesh
2022 gold badges7 silver badges18 bronze badges

3 Answers

Execute Exe With Parameters Free

To start the process with parameters, you can use following code:

To kill/exit the program again, you can use following code:

amhed
2,8462 gold badges24 silver badges53 bronze badges
Stephan BauerStephan Bauer
7,5883 gold badges30 silver badges53 bronze badges
undoneundone
7,2014 gold badges37 silver badges66 bronze badges
Zied RebhiZied Rebhi
4,3701 gold badge31 silver badges57 bronze badges

Execute Exe With Parameters Cmd

Not the answer you're looking for? Browse other questions tagged c#executable or ask your own question.