The script I want to start when my Win10 pc starts is just one line:
RAlt::Send !{f4}
But this line must run as ADMIN else it won't function right.
Lots of different ways to do this online. But some look very dated.
Easiest way for 2021?
thanks!
What's the best way to run my AHK script as ADMIN at startup (Win 10 64-bit PC)? Topic is solved
Re: What's the best way to run my AHK script as ADMIN at startup (Win 10 64-bit PC)?
I'm not sure about previous years, but this year, you could do it this way: https://www.autohotkey.com/docs/commands/Run.htm#RunAs
Re: What's the best way to run my AHK script as ADMIN at startup (Win 10 64-bit PC)?
Thanks!mikeyww wrote: ↑27 Sep 2021, 19:42I'm not sure about previous years, but this year, you could do it this way: https://www.autohotkey.com/docs/commands/Run.htm#RunAs
That works good.
The only problem is that MS Windows presents me with that big yellow screen at PC startup, asking me if i'm SURE that I want to start my script.
Way around this?
Re: What's the best way to run my AHK script as ADMIN at startup (Win 10 64-bit PC)?
I don't use UAC, but here is some info that might help. https://www.autohotkey.com/docs/FAQ.htm#uac
Re: What's the best way to run my AHK script as ADMIN at startup (Win 10 64-bit PC)?
You may be able to make use of RunAsTask.
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
Re: What's the best way to run my AHK script as ADMIN at startup (Win 10 64-bit PC)?
You could just create a task in the Windows Task Scheduler to run at startup or login. It's a lot easier than creating a script to do it for you.
When you create it from the Action menu, choose "Create Task", not "Create basic task". That will give you the option to select "Run with highest privileges." There are lots of tutorials or youtube videos to show you how to create a task.
Russ
When you create it from the Action menu, choose "Create Task", not "Create basic task". That will give you the option to select "Run with highest privileges." There are lots of tutorials or youtube videos to show you how to create a task.
Russ
Re: What's the best way to run my AHK script as ADMIN at startup (Win 10 64-bit PC)?
Thanks, that's a good idea.RussF wrote: ↑29 Sep 2021, 07:59You could just create a task in the Windows Task Scheduler to run at startup or login. It's a lot easier than creating a script to do it for you.
When you create it from the Action menu, choose "Create Task", not "Create basic task". That will give you the option to select "Run with highest privileges." There are lots of tutorials or youtube videos to show you how to create a task.
It seems that, in Task Scheduler, I can't just link to the AHK file.
Instead, I have to link to the exe itself, and pass the exe arguments to run my specific file.
Do you know what they are? It seems there should be some sort of OPEN command that i can use to pass my ahk file to. Something like this:
AutoHotkey.exe -open "c:\my cool scripts\my startup script.ahk"
<see image>
https://i.imgur.com/KidOlbC.jpg
Re: What's the best way to run my AHK script as ADMIN at startup (Win 10 64-bit PC)?
thanks that worked !
Who is online
Users browsing this forum: NinjoOnline and 320 guests