Author Topic: User Account Control using QB64  (Read 3313 times)

0 Members and 1 Guest are viewing this topic.

Offline Richard

  • Seasoned Forum Regular
  • Posts: 364
    • View Profile
User Account Control using QB64
« on: December 19, 2020, 10:27:37 am »
Anyone have any code or suggestions for Windows 10 x 64 (latest builds) for disabling User Account Control for a specific application (eg by defining a trusted shortcut).

Apparently it WAS possible using standard Windows security APIs and custom made algorithms to run single processes with direct access to Administrator Token without UAC prompt.

Apparently Windows 7 allowed this feature without software and also early versions of Windows 10.

Google searches resulted in software that does not work with recent windows 10 builds, and some people claiming "..." works but others say methods do not necessarily work with all apps. Windows Task Manager says "not allowed" for UAC change for a particular app I want to use. I am reluctant to download a 1 Gbyte Windows Assessment and Deployment Kit  application package from Microsoft (usually such large files do not work with my current version of windows) and indication from some people warn that it may not work.

Currently, in Windows 10 I have COMPLETELY disabled UAC for EVERYTHING - I would prefer to do so only for selected apps I have used many times and trusted.
« Last Edit: December 19, 2020, 10:34:26 am by Richard »

Offline zaadstra

  • Newbie
  • Posts: 78
    • View Profile
Re: User Account Control using QB64
« Reply #1 on: January 02, 2021, 12:14:15 pm »
It doesn't seem to be possible to allow selected programs to run elevated.

There are some tricks however.  Here is a page describing the thing:
https://answers.microsoft.com/en-us/windows/forum/windows_10-security-winpc/disabling-uac-approval-for-specific-programs-in/745a3740-679a-42f9-9c51-59475c9cd2ff?auth=1

The TaskSheduler trick might be an option:  https://www.winhelponline.com/blog/run-programs-elevated-without-getting-the-uac-prompt/

Here is another trick, which I use to run a batch file auto elevated. This batch could start your program:
https://www.winhelponline.com/blog/automatically-elevate-batch-file-run-administrator/

Hope this helps!

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: User Account Control using QB64
« Reply #2 on: January 02, 2021, 12:24:49 pm »
https://www.qb64.org/forum/index.php?topic=1281.msg104858#msg104858

Look at the code at the link above.  It shows how to self-elevate a program.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: User Account Control using QB64
« Reply #3 on: January 02, 2021, 08:15:54 pm »
@Richard Just make sure you read the bit about the correct error level return code for that self elevating code that Steve is referencing. You will need to check what the return values are. Mine had 2 and 5. When I ran the code that was originally posted it made the program open up dozens of times before I could stop it.
Shuwatch!