Toolbar button runs a program with or without admin rights

I have a particular issue whereby I need to run NotePad++.exe without admin rights but only
if I am accessing a file on my Samba share. I Currently have a toolbar button defined as
%envFldProgramFilesX64%\NotePad++\NotePad++.exe {allfilepath}. Under NotePad++.exe
Properties>Compatibility it is currently set to “Run this program as an administrator”, which I need
to do most of the time. My Samba share drive letter is P:. Is there some way I can test {allfilepath}
for the drive letter P: and act accordingly, run with or without admin rights?

Thanks
Bob Gregory

You can use @ifpath to run different commands when in different paths, and @admin: before the command line to run it elevated (leaving it out to run it normally).

Details here: Command Modifier Reference

If more complex logic is needed, scripting can do just about anything, but probably isn't needed here.

Thank you Leo. I should have seen that in the doc. Sorry.
Bob Gregory

1 Like

No problem, there's so much in the manual that it's easy to miss things!