| View previous topic :: View next topic |
| Author |
Message |
Dmitry
Joined: 02 Jun 2005 Posts: 48 Location: Moscow
|
Posted: Wed Jun 15, 2005 11:41 am Post subject: A_Startup and A_StartupCommon |
|
|
It seems to me that both A_Startup and A_StartupCommon return the same value, namely:
C:\Documents and Settings\All Users\Start Menu\Programs\Startup
Is it a bug or my own mistake?
I'm under XP |
|
| Back to top |
|
 |
mario_a
Joined: 12 Dec 2004 Posts: 51
|
Posted: Wed Jun 15, 2005 7:13 pm Post subject: |
|
|
On my machine (XP Pro, SP2, AutoHotkey v1.0.35.05) they both return different values :
A_Startup = C:\Documents and Settings\UserName\Start Menu\Programs\Startup
A_StartupCommon = C:\Documents and Settings\All Users\Start Menu\Programs\Startup |
|
| Back to top |
|
 |
TeknoMusicMan
Joined: 14 Apr 2005 Posts: 186 Location: Wisconsin, USA
|
Posted: Wed Jun 15, 2005 8:08 pm Post subject: |
|
|
The only way that they should return the same value is if somehow you magically logged in as "all users" and I'm 99% sure thats not possible. _________________
"Make it idiot-proof, and someone will make a better idiot." |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10716
|
Posted: Wed Jun 15, 2005 10:02 pm Post subject: |
|
|
I checked the code and these two values are read from the following registry locations:
Common: HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "Common Startup"
User: HKEY_CURRENT_USER, "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "Startup"
However, I notice that it falls back to the user's startup folder if the RegRead for "common" fails. Perhaps your username lacks permission to query HKEY_LOCAL_MACHINE? If this is what's happening, I will add this info to the help file. |
|
| Back to top |
|
 |
Dmitry
Joined: 02 Jun 2005 Posts: 48 Location: Moscow
|
Posted: Thu Jun 16, 2005 7:55 am Post subject: |
|
|
Thank you very much!
Actually it was a wrong value in the
HKEY_CURRENT_USER, "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "Startup"
I don't know how it happened. I did not change anything in registry by my hands. My username have all administrative permission on this computer. Any assumptions? |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7290 Location: Australia
|
Posted: Mon Feb 02, 2009 8:53 am Post subject: |
|
|
According to an old (though not as old as this thread) blog entry by Raymond Chen, the Shell Folders registry key exists only for backward-compatibility with applications that were written before Windows 95 even came out. If you browse to Shell Folders in HKCU of a recent version of Windows, you may find the following value:
| Code: | | !Do not use this registry key = Use the SHGetFolderPath or SHGetKnownFolderPath function instead |
It is possible that Dmitry's registry keys where out of sync with the actual locations, but this would not have been a problem if the correct functions were used. (This is why I've revived this thread rather than creating a new one.) |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10716
|
Posted: Fri Feb 13, 2009 3:45 pm Post subject: |
|
|
Good to know; thanks.
To be compatible on all OSes, it looks like SHGetSpecialFolderLocation() is the one to use. Unless you or someone else feels like doing it, I've made a note to rewrite the routines for A_Startup, etc. |
|
| Back to top |
|
 |
|