Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

autohotkey script at windows startup



  • Please log in to reply
16 replies to this topic
rosto
  • Members
  • 130 posts
  • Last active: Jan 06 2016 01:50 PM
  • Joined: 14 Feb 2006

I changed my OS from windows xp to windows 8.

 

I'm trying to start my .ahk script at windows startup as before.

 

I installed the script in the startup directory with admin rights.

The script is activated after a windows startup but it doesn't work.

 

Then I installed the script in scheduled tasks with admin privilege.

Again the script is activated after a windows startup but it doesn't work.

 

In both cases, the only way to make my script work is to right click on the icon in the system bar and reload the script.

 

What did I wrong?

How can I resolve this problem?



garry
  • Spam Officer
  • 3219 posts
  • Last active: Sep 20 2018 02:47 PM
  • Joined: 19 Apr 2005

have you tried  to add your  links from *.ahk files here (?)

and in script should have the command at first  =  setworkingdir,%a_scriptdir%

 

( sorry , I have XP )

fd=%a_startupcommon%
run,%fd%



rosto
  • Members
  • 130 posts
  • Last active: Jan 06 2016 01:50 PM
  • Joined: 14 Feb 2006

have you tried to add your *.ahk files here (?)
and in script should have the command at first = setworkingdir,%a_scriptdir%

( sorry , I have XP )

fd=%a_startupcommon%run,%fd%

Sorry I don't understand what you mean. Can you please explain yourself a bit more?



jNizM
  • Members
  • 928 posts
  • Last active: Jan 12 2018 09:23 AM
  • Joined: 01 Aug 2012
AHK Variables

A_Startup
The full path and name of the Startup folder in the current user's Start Menu.

A_StartupCommon
The full path and name of the Startup folder in the all-users Start Menu.
[AHK] 1.1.27.04 x64 Unicode | [WIN] 10 Pro (Version 1709)
My GitHub Profile | Donations are appreciated if I could help you

Rijul Ahuja
  • Members
  • 763 posts
  • Last active: Nov 25 2013 10:16 AM
  • Joined: 14 Mar 2012
✓  Best Answer

I would suggest creating an elevated shortcut (for Admin purposes) using this app : http://winaero.com/c...omment.news.152

Now go to run, type shell:startup and click OK.

Cut and paste the shortcut there, and the script will start itself as administrator (without prompt) when you log in to windows


Abandon the forum. The community has decided in a democratic vote to leave this website because of inactive and perverse administration.

Very few of the contributing members remain here.


garry
  • Spam Officer
  • 3219 posts
  • Last active: Sep 20 2018 02:47 PM
  • Joined: 19 Apr 2005

sorry I have XP , example above with a_startupcommon works for me ( put links from ahk scripts in this folder for autostart )



Rijul Ahuja
  • Members
  • 763 posts
  • Last active: Nov 25 2013 10:16 AM
  • Joined: 14 Mar 2012

Sorry, I didn't see the second post. If and when you move to Win 7 / 8, remember this, it helps. A lot.


Abandon the forum. The community has decided in a democratic vote to leave this website because of inactive and perverse administration.

Very few of the contributing members remain here.


rosto
  • Members
  • 130 posts
  • Last active: Jan 06 2016 01:50 PM
  • Joined: 14 Feb 2006

Whatever I do doesn't work.

 

I noted that the script file is not even loaded.

I've put it in the startup directory.

Give it the admin privilege.

 

Tried also to use a software as elevate shortcut but as before the script is not even loaded.

Tried also to add it in scheduled tasks with admin privilege.

 

I don't know what to do anymore.

I uninstalled also ahk and reinstalled an old 32 bit version.

No change.

 

When I open the script manually (double clicking on it), everything works fine.

 

(btw still don't understand where garry is speaking about:

setworkingdir,%a_scriptdir%

 

d=%a_startupcommon%

run,%fd%)



garry
  • Spam Officer
  • 3219 posts
  • Last active: Sep 20 2018 02:47 PM
  • Joined: 19 Apr 2005

( autostart with my XP netbook    (  but you have Windows 8  )    , I put links to folder %a_startupcommon%  ( not the file xy.ahk )  )

I put the links from my ahk-scripts to this folder ( which I want to start when I switch on the computer ( autostart) )  =

run,%a_startupcommon%

 

the scripts should contain the command > setworkingdir,%a_scriptdir%



JadeDragon
  • Members
  • 935 posts
  • Last active: Jun 07 2014 07:40 AM
  • Joined: 18 Jan 2013

My answer to EVERY win 8 problem was dual boot Win 7 and Ubuntu Linux. I have had this new machine 2 days and so far nothing but problems. Completely solved by making sure Win 8 was cut off at the knees. So that's what i did. Amazingly, now everything works just grand! Win 8 I never knew ya! grin.png


Never assume evil intent when simple ignorance will suffice. Ignorance is an eventually curable condition with the right education. Evil intent, however, is another matter entirely. Scripts are much like children. Simple to conceive. Difficult, expensive, and time-consuming to raise. Often do the opposite of what you expect them to. Require frequent  "correction". And once they leave home you can't control them anymore. But you love them anyway.


rosto
  • Members
  • 130 posts
  • Last active: Jan 06 2016 01:50 PM
  • Joined: 14 Feb 2006

Garry, I still don't understand what I have to do with all these variables. Do I have to place them in my script?

I have not much experience with autohotkey programming.

I'm trying to read something about these variables on the web but cannot find clear information, only a lot of scripts.

 

I'm thinking to have a look at autoit.

There seems to be no answer for my problem and I have already spent a lot of time on it.

Everything went fine on xp but now the same scripts makes me crazy.



garry
  • Spam Officer
  • 3219 posts
  • Last active: Sep 20 2018 02:47 PM
  • Joined: 19 Apr 2005

the variable %a_startupcommon% opens (german)  C:\Dokumente und Einstellungen\All Users\Startmen├╝\Programme\Autostart , this is the folder I put some links here to start my ahk-scripts

but maybe not works with Windows-8

ask again for windows-8 problem ( sorry I answered for XP example )



rosto
  • Members
  • 130 posts
  • Last active: Jan 06 2016 01:50 PM
  • Joined: 14 Feb 2006

I can't make this stupid ahk script work as I startup the pc.

During 2 days I tried all what I know (and what I've read) but still it doesn't work.

Not in .exe not in .ahk.

I find it now in the system bar at windows startup but it doesn't work untill I right click on it and click on reload.

 

Is there nobody who can help me?

Admins?

What's happening???



blued
  • Members
  • 5 posts
  • Last active: Jul 04 2014 11:19 AM
  • Joined: 17 Jul 2007

Although the thread may be a little old, maybe this can be of use to somebody having problems with running AHK at startup.  Windows 8/8.1 is sometimes picky at what it allows to run at startup, but using task-scheduler it can be done. Just create a basic task in taskschduler for the app/script to run at logon, fill in the appropriate task options, and thats it.



AUserInEssex
  • Members
  • 6 posts
  • Last active: Sep 29 2014 09:05 PM
  • Joined: 17 Jul 2014

I - still - have this problem!

 

Autohotkey (compiled) scripts do not autostart under Windows 8.1. whether my means to trying to achieve that is the task scheduler, autorun from the registry, autorun from 'startup folder' - nothing works. Moreover, giving the program admin privileges seems to make no difference.

 

Please help!