Run as Admjnistrator

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
samardac
Posts: 212
Joined: 30 Nov 2014, 13:36

Run as Admjnistrator

26 Aug 2016, 07:29

Hi, my script works only when I run it with - Run As Administrator.
How to fix it?
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: Run as Admjnistrator

26 Aug 2016, 07:42

You don't leave many clues. Perhaps you can start here: UAC.
samardac
Posts: 212
Joined: 30 Nov 2014, 13:36

Re: Run as Admjnistrator

26 Aug 2016, 07:46

Helgef wrote:You don't leave many clues. Perhaps you can start here: UAC.
What clues you need to unswer my question? I think everything is clear.
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: Run as Admjnistrator

26 Aug 2016, 08:00

samardac wrote:I think everything is clear.
Good then!
samardac
Posts: 212
Joined: 30 Nov 2014, 13:36

Re: Run as Admjnistrator

26 Aug 2016, 08:52

Helgef wrote:
samardac wrote:I think everything is clear.
Good then!
My script try to create folder in A_Temp, or try to modify registr but no luck only it works only if you run exe As Administrator.
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: Run as Admjnistrator

26 Aug 2016, 09:07

That's how windows works, nothing to do with ahk, you need permision (admin) to do stuff on certain places, the link I provided suggests some "Common workarounds". I don't know, but I think A_MyDocuments is less restricted. Btw, I can write to A_Temp without script being admin, probably because UAC settings.
samardac
Posts: 212
Joined: 30 Nov 2014, 13:36

Re: Run as Admjnistrator

26 Aug 2016, 09:22

Helgef wrote:That's how windows works, nothing to do with ahk, you need permision (admin) to do stuff on certain places, the link I provided suggests some "Common workarounds". I don't know, but I think A_MyDocuments is less restricted. Btw, I can write to A_Temp without script being admin, probably because UAC settings.
That work arounds are very complex foe me, would be greate to have some simple instructions.
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: Run as Admjnistrator

26 Aug 2016, 09:33

would be greate to have some simple instructions.
I have nothing else, maybe someone else saves the day, if not, you should consider to modify your script such that it doesn't rely on admin privileges.
Good luck.
Guest

Re: Run as Admjnistrator

26 Aug 2016, 10:45

Would it help to have the script run as Admin automatically? If so, add this to the top of your script...

Code: Select all

#singleinstance off
if not A_IsAdmin
{
	Run *RunAs "%A_AhkPath%" "%A_ScriptFullPath%"
   	ExitApp
}

samardac
Posts: 212
Joined: 30 Nov 2014, 13:36

Re: Run as Admjnistrator

26 Aug 2016, 12:50

Guest wrote:Would it help to have the script run as Admin automatically? If so, add this to the top of your script...

Code: Select all

#singleinstance off
if not A_IsAdmin
{
	Run *RunAs "%A_AhkPath%" "%A_ScriptFullPath%"
   	ExitApp
}

*RunAs dose not work I tried it :(

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee, gsxr1300, inseption86, jaka1, mebelantikjaya and 299 guests