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 

A_Startup and A_StartupCommon

 
Reply to topic    AutoHotkey Community Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
Dmitry



Joined: 02 Jun 2005
Posts: 48
Location: Moscow

PostPosted: Wed Jun 15, 2005 11:41 am    Post subject: A_Startup and A_StartupCommon Reply with quote

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
View user's profile Send private message
mario_a



Joined: 12 Dec 2004
Posts: 51

PostPosted: Wed Jun 15, 2005 7:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
TeknoMusicMan



Joined: 14 Apr 2005
Posts: 186
Location: Wisconsin, USA

PostPosted: Wed Jun 15, 2005 8:08 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Wed Jun 15, 2005 10:02 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Dmitry



Joined: 02 Jun 2005
Posts: 48
Location: Moscow

PostPosted: Thu Jun 16, 2005 7:55 am    Post subject: Reply with quote

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
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 7290
Location: Australia

PostPosted: Mon Feb 02, 2009 8:53 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Fri Feb 13, 2009 3:45 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Bug Reports 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