Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have you even considered and taken care of such cases where the path ('%0') could contain spaces somewhere ?? Like in %USERNAME% ?? #2

Open
vivek1986 opened this issue Aug 9, 2023 · 1 comment

Comments

@vivek1986
Copy link

As I specified in the Issue title, there are cases where '%0' could have spaces in the path anywhere like in %USERNAME%(Vivek Shah), and you have clearly not handled those cases while passing the parameter as '%0' which breaks the script in those cases and throws given error:

The term 'C:\Users\Vivek' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:1

See this Stackoverflow Question that I had to ask due to this blocking issue..

Can you atleast suggest any immediate fixes for this ??

@tsgrgo
Copy link
Owner

tsgrgo commented Aug 9, 2023

Hi! Thank you for reporting this bug and special thanks for linking the StackOverflow question! I've (hopefully) fixed the problem with the latest commit.

%0 resolves to the current file path enclosed with double quotes, so that should work. The problem was with %~dp0\PsExec.exe because %~dp0 removes any surrounding quotation marks.

Let me know if it now works on your end too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants