Beej126 / SingleInstanceAccumulator

Useful for multi-file shell context menu actions
10 stars 2 forks source link

Added single quotes check when path to the program has spaces #5

Closed lukadj996 closed 1 year ago

lukadj996 commented 1 year ago

Hello I don't know if you noticed but when you call SingleInstanceAccumulator.exe -q:' "-c:C:\Users\some folder\test.exe $files it just splits cmdLine where the " " is and it tries to start the process with file name, in this case, C:\Users\some instead of C:\Users\some folder\test.exe I added regex check to see if there is text at the beginning of cmdLine inside single quotes and it uses it as filename. Now you can use -c:C:\Without_spaces_no_quotes\test.exe $files or if you have space in you path then -c:'C:\With spaces and quotes\test.exe' $files

Beej126 commented 1 year ago

check out #3 about escaping spaces in powershell under my General Tips... if that's not an option for you please give a little background in case i can help further... i'm currently not inclined to take this PR but it's of course fine if you care to fork

lukadj996 commented 1 year ago

Now I see that I could probably use cmd or PS escape but for some reason I didn't succeed first time I tried. Thank you for response I even rewrited this tool in Go lang just for fun. BR, Luka