admin and non-admin access at the same time

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
j5_
Posts: 2
Joined: 21 Apr 2022, 19:54

admin and non-admin access at the same time

06 Apr 2024, 10:29

about my pc: I use a non-admin account with password, while admin account is also password protected. This is Windows 10 64 bit
I have created a gui with two buttons say button_1 and button_2
Now say i want to lanuch a cmd window with button_1 as non-admin, but when i click button_2 it should launch a cmd window as admin
THE CONDITION IS I DO NOT WANT TO ENTER THE PASSWORD EVERY TIME I CLICK ONE OF THE BUTTON. ALSO I DO NOT WANT TO SAVE MY PASSWORD IN ANY SCRIPT FILE.
What I have tried: -
: I only way i could think to handle this situation, is having two scripts running, one as non-admin with gui, the other as admin in background without gui. so the idea is the non-admin script asks admin script to do something
1. SendMessage, PostMessage, OnMessage := This gives access denied error, may be a non-admin script cannot pass message to admin script
2. ControlClick := same, cannot send click from non-admin gui to a gui created by admin-script

3. hotkeys := i send a hotkey from non-admin script and the same is detected by admin script.
{

Code: Select all

SendInput "!{VK01}" ; this sends hotkey from non-admin script
{

Code: Select all

!VK01::
{
	function_do_something()
}; this is read by admin-script and it perform some action
this method is working but i am not satisfied with it, first there is always chance that this may trigger something else or it may not trigger
also VK101 triggers VK01 also, this means i cannot go beyond VKFF (or VK99 may be, I have not tried)

1. New methods are welcome, i.e. something crazy like one gui sending clicks to two scripts
2. new ways for communication between two scripts are also welcome
3. new sets of hotkeys at last will also work, the condition is they should be be numerous i.e. 10000, and should not be general hotkeys like ^F1 or !p

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: robinson and 37 guests