AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Registry Entry Query

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Bambi
Guest





PostPosted: Mon Oct 15, 2007 6:33 pm    Post subject: Registry Entry Query Reply with quote

I have compiled an exe file containing my Hotkeys, which I would like it to auto load (start) every time the computer is switched on. Instead of putting this exe file in the start-up menu of the computer or using the AHK FileCreateShortcut command, I would like to have it auto load through a Registry Entry.

I have come up with the code given below and was wondering whether someone could assert that this code is correct. I am rather scared and apprehensive to mess around with the Registry and I will implement it only if someone can certify that this code will work as intended.

To highlight my example – abc.exe is the name of the exe file that I have compiled and it is under the C:\Test\ folder / directory on my computer.

The code is –

Code:
RegWrite,REG_SZ,HKEY_LOCAL_MACHINE,Software\Microsoft\Windows\CurrentVersion\Run C:\Test\abc.exe

Also, for this to work must the Registry Entry be entered in the HKEY_CURRENT_USER section also or would it suffice if it is entered only in the HKEY_LOCAL_MACHINE section as given above.

Is the above correct?

Please assist…
Back to top
psjw12



Joined: 10 May 2007
Posts: 25

PostPosted: Mon Oct 15, 2007 9:12 pm    Post subject: Reply with quote

You've missed a comma out at the end

Code:
RegWrite,REG_SZ,HKEY_LOCAL_MACHINE,Software\Microsoft\Windows\CurrentVersion\Run, C:\Test\abc.exe


If you put it under HKEY_CURRENT_USER it will start up only on your user account, if you put it in HKEY_LOCAL_MACHINE it will start up for anyone who uses the computer.

Hope this helps.
Back to top
View user's profile Send private message
Bambi
Guest





PostPosted: Thu Oct 18, 2007 3:00 am    Post subject: Reply with quote

I modified the code as suggested by psjw12 but unfortunately the exe file does not auto start when the computer is switched on. Essentially, I would like the Registry Entry to emulate what the AHK FileCreateShortcut command does – that is – auto start the exe file every time the computer is started.

Basically, on the lines on the above code, I created a Folder (Directory) called C:\Program Files\Test and copied my exe file (abc.exe) to that Folder. I tried using the following code but unfortunately it didn’t work as intended.

Code:
RegWrite,REG_SZ,HKEY_LOCAL_MACHINE,Software\Microsoft\Windows\CurrentVersion\Run, C:\Program Files\Test\abc.exe


Can someone please identify and rectify what am I doing wrong?
Back to top
Lexikos



Joined: 17 Oct 2006
Posts: 2739
Location: Australia, Qld

PostPosted: Thu Oct 18, 2007 11:02 am    Post subject: Reply with quote

The value name is for informational and identification purposes - the value data is what is launched. In this case:
Code:
RegWrite,REG_SZ,HKEY_LOCAL_MACHINE,Software\Microsoft\Windows\CurrentVersion\Run, C:\Program Files\Test\abc.exe
the name is
Code:
C:\Program Files\Test\abc.exe
and the path is
Code:
(nothing)

Try this:
Code:
RegWrite,REG_SZ,HKEY_LOCAL_MACHINE,Software\Microsoft\Windows\CurrentVersion\Run, abc, C:\Program Files\Test\abc.exe
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group