rcmaehl Posted June 18, 2018 Share Posted June 18, 2018 Hi all, I'm experiencing an issue with Powershell passing trailing spaces within arguments and I'm quite restricted on what I can do due to contractual agreements. Is there a way to resolve this? Input: Powershell Start-Process 'C:\Program Files\Folder\program.exe' -Verb runAs -ArgumentList @('"parameter with spaces"', '-minimize') Expected Passed Parameters: "parameter with spaces" "-minimize" Actual Passed Parameters: "parameter with spaces " "-minimize " Limitations Program.exe must be ran from a program already running as admin (in this case powershell) Not allowed to change default Execution Policy away from Restricted. So no Powershell scripts Not allowed to install/execute external programs (so no AutoIt Scripts) Works if made into a shortcut (.lnk) on the Desktop Any advice would be appreciated. Thanks in advance My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.My Projects WhyNotWin11Cisco Finesse, Github, IRC UDF, WindowEx UDF Link to comment Share on other sites More sharing options...
Danyfirex Posted June 20, 2018 Share Posted June 20, 2018 Hello. Something like this should work from powershell. Start-Process 'C:\Program Files\Folder\program.exe' -Verb runAs -ArgumentList @("`"parameter with spaces`"","`"-minimize `"") Saludos rcmaehl 1 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
rcmaehl Posted June 20, 2018 Author Share Posted June 20, 2018 I'll give it a try! Thanks! My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.My Projects WhyNotWin11Cisco Finesse, Github, IRC UDF, WindowEx UDF Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now