Or you could even use New-PSSession, but that is probably a step too far. Here, we define variables for each external command element, and then plug the variables into our call: That last statement reminds me of Perl. For more information, see Powershell.exe - PowerShell - SS64.com Navigate to the file system location your script is located using the Set-Location PowerShell cmdlet or the cd alias. about PowerShell exe - PowerShell | Microsoft Learn I try to batch it, powershell it, shortcut etc 1 of 2 things happens. To learn more, see our tips on writing great answers. Any native command can be run from the PowerShell command line. This is unrelated to the ops question, he specifically asked how to run the long command in his post in powershell. This article only focuses on running exe files with parameters because the normal exe file execution (without parameters) is quite straightforward if it is already in the Windows PATH. Sorry, in PowerShell we write $ENV:COMPUTERNAME, not %COMPUTERNAME%, $command='cmd.exe /C C:\DriverBU\DrvBK.exe MODE=BACKUP"BKPATH=C:\TempDrivers BKDESC=Drivers BKFILE="Backup %NOW% %COMPUTERNAME%.bki" BKPATHFTM="%COMPUTERNAME%" BKDEVFMT=%DEVNAME% BKDATEFMT="" OPT=HW'. How do I go about creating a link for users who access a remote share, so that a user may click on an object, and launch the application on the share along with it's argument, and have it so that all teh work takes place on teh remote server, non on the local machien of the user trying to launch the app. For more information, see the following articles: PowerShell 7.2 introduced a new experimental feature PSnativeCommandArgumentPassing that improved Now we can launch Powershell.exe and pass the encoded commands: powershell.exe -NoProfile -EncodedCommand $encoded Exit Codes In PowerShell the exitcode is stored in the automatic variable $LASTEXITCODE. Connect and share knowledge within a single location that is structured and easy to search. Try that and let me know if it works. To continue this discussion, please ask a new question. Is it an InstallShield installer? How do you run the following command in PowerShell? You don't necessarily need to have variables or even the call operator (&) if you don't have spaces in arguments, path, etc.