AutoHotkey Community

It is currently May 26th, 2012, 6:09 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: June 15th, 2005, 12:41 pm 
Offline

Joined: June 2nd, 2005, 8:25 am
Posts: 48
Location: Moscow
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 15th, 2005, 8:13 pm 
Offline

Joined: December 12th, 2004, 1:34 pm
Posts: 51
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 15th, 2005, 9:08 pm 
Offline

Joined: April 14th, 2005, 11:11 am
Posts: 186
Location: Wisconsin, USA
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.

_________________
Image
"Make it idiot-proof, and someone will make a better idiot."


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 15th, 2005, 11:02 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 16th, 2005, 8:55 am 
Offline

Joined: June 2nd, 2005, 8:25 am
Posts: 48
Location: Moscow
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 2nd, 2009, 9:53 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
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.)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 13th, 2009, 4:45 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
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.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group