Sorry, parameters using list files are not compatible with "as administrator". Why? TC has to wait for the called program to terminate (to delete the temporary list file), which isn't possible if the program runs in a different user account.
Ah, sorry, I didn't look close enough. %S doesn't work because I have to use CreateProcess instead of ShellExecute, because CreateProcess supports a much longer command line. However, CreateProcess doesn't support elevation. I could use ShellExecute for shorter command lines and CreateProcess for longer, but then you would get the problem suddenly when selecting more than a certain number of files.
I was never concerned about the commandline length limit, so I guess 2048 is enough with me. But not so sure about other users as it's indeed far too shorter than 32767. Since I may workaround the problem by passing the command to powershell I suppose better leave the current behaviour as it is to avoid confusion.
If you always need to run button as admin, you can use my Sudo tool, it works even with %L. It uses ShellExecuteEx function and passes command line as is w/o truncation.
It is quite easy in use: just insert full path to Sudo.exe before your program path in Command: field.
MVV wrote:If you always need to run button as admin, you can use my Sudo tool, it works even with %L.
I was aware of it but I didn't use it as there's only x86 version and I'm on x64 and concerned about the path redirections, 'System32/SysWOW64' and 'Sysnative/System32'. Anyway, powershell is handy too for this job as far as the commandline doesn't need quotes.
For now, I have just enabled it without a warning, because there seem to be several length limits - for example, cmd.exe seems to have a limit of 2047 characters, while ShellExecute has one of 8191 (on Windows 7).
Sorry, my question is not directly related to the subject of this topic.
Hello MVV. Does sudo.exe return the error code of the executed application? I did not find information file in the zip. Are you planning to prepare/share 64 bit version of it?