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 Wiechers2 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 toInstall.xml
too. Use theBuildPath
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
).
Thanks guys! I mixed it up and made this that works for me. (Not sure if something could be made cleaner, but it works!)
Not the answer you're looking for? Browse other questions tagged vbscriptparameters or ask your own question.
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?
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.
Any help would be greatly appreciated.
Sai Avinash3 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