[Win10] CompareTool = CompareScript.ahk doesn't work anymore

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Do you get user account control dialog when trying to run the script? F4 doesn't support UAC. I do NOT get UAC when running the script.
Author of Total Commander
https://www.ghisler.com
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Christian,
Do you get user account control dialog when trying to run the script?
Nope.
F4 doesn't support UAC.
Umm, we're talking about the CompareTool= INI setting, right?

Thanks
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Yes, TC uses CreateProcessW to execute the external compare command. CreateProcessW can handle very long command lines, but it cannot trigger the user account control dialog (UAC). Therefore programs which need to run with higher user rights cannot be started with CreateProcessW.
Author of Total Commander
https://www.ghisler.com
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Christian,
I see and I found the culprit now. I am using an AutoHotkey.exe that requests "UI Access" so that it can work with programs that run at a higher privilige level:
With User Account Control (UAC) enabled, most programs are prevented from interacting with any windows which are running at a higher privilege level. For AutoHotkey, this usually means that hotkeys and Send won't work with administrative programs unless the script is also run as administrator. Running a script as administrator is fairly simple; however, it has at least two significant drawbacks:

The need to deal with a UAC prompt each time the script starts.
Any programs the script launches also receive administrative privileges.

Microsoft's recommended solution is to flag the application as one that needs "UI access,"
Enable interaction with administrative programs - Scripts and Functions - AutoHotkey Community
Run with UI Access - AHK Help
How do I work around problems caused by User Account Control (UAC)? - AHK Help

Since the AutoHotkey.exe (with UI Access flag) is signed with a certificate and in a trusted location (Program Files), this works without needing to show an UAC prompt.
My current workaround which seems to work fine so far is specifying a non-UI Access AutoHotkeyU64.exe to run the compare script, i.e.:

Code: Select all

CompareTool="C:\Program Files\AutoHotkey\AutoHotkeyU64.exe" C:\Programy\AutoHotkey\Scripts\CompareFiles.ahk
Is there any way TC could run programs flagged as UI Access as the compare tool?

Thank you.
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

2Hacker
Perhaps you could use the little tool Elevate to launch AutoHotkey?

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Dalai,
I am not really sure how it could help in this situation. Mind elaborating?

Thank you
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

Well, if you intend to launch AutoHotkey as admin - which is one way to interact with elevated programs - Elevate can help you with that. On the other hand, runas.exe is already part of Windows, which might work in the same way.

One thing to note is that all programs launched by this particular AutoHotkey (script) will run elevated as well.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Dalai,
Ah, I see. Well, I am using the UI Access version exactly because I don't want to run AHK as admin.
But thank you nevertheless.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Post Reply