[THIN] Re: Explorer shell folders in hkey_users\.default\ (reg_sz keys &environment variables)

  • From: "Rick Mack" <Rick.Mack@xxxxxxxxxxxxxx>
  • To: <thin@xxxxxxxxxxxxx>
  • Date: Fri, 24 Mar 2006 08:55:24 +1000

Hi Jeremy,
 
There's a fairly simple rule controlling which string type should be used. If 
you want a variable to be parsed (replaced with variable value) you have to use 
reg_expand_sz, if you just want to store a value with %signs around it, reg_sz 
is fine.
 
regards,
 
Rick
 
Ulrich Mack 
Volante Systems 


________________________________

From: thin-bounce@xxxxxxxxxxxxx on behalf of Jeremy Saunders
Sent: Fri 24/03/2006 0:02
To: thin@xxxxxxxxxxxxx
Subject: [THIN] Re: Explorer shell folders in hkey_users\.default\ (reg_sz keys 
&environment variables)



Hi Joe,

If REG_SZ works without giving you problems, then it should be okay for
you. However, I always use REG_EXPAND_SZ simply because Microsoft say you
should. With REG_EXPAND_SZ string values, you can safely use environment
variables for paths that are stored in the registry. This ensures that the
any environment variable used is correctly expanded. Leaving it as a REG_SZ
value can provide inconsistent results depending on how well the
application accessing the keys has been written.

As a note you shouldn't be directly modifying the anything under the "Shell
Folders" key, just the "User Shell Folders" key.

And whilst you can change the REG type, you can delete the REG_SZ and
recreate it as a REG_EXPAND_SZ.

Whilst that's not a difinitive answer, it may give you a guide.
                                                               
 Kind regards,                                                 
                                                               
 Jeremy Saunders                                               
 Senior Technical Specialist                                   
                                                               
 Integrated Technology Services &                              
 Cerulean                                                      
 IBM Australia                                                 
 Level 2, 1060 Hay Street                                      
 West Perth  WA  6005                                          
                                                               
 Visit us at                                                   
 http://www.ibm.com/services/au/its                            
                                                               
 P:  +61 8 9261 8412                F:  +61 8 9261 8486        
 M:  TBA                            E-mail:                    
                                    jeremy.saunders@xxxxxxxxxxx
                                                               
                                                               








                                                                          
             "Joe Grainger"                                               
             <jag@xxxxxxxxxxxx                                            
             o.uk>                                                      To
             Sent by:                  <thin@xxxxxxxxxxxxx>               
             thin-bounce@freel                                          cc
             ists.org                                                     
                                                                   Subject
                                       [THIN] Explorer shell folders in   
             23/03/2006 07:42          hkey_users\.default\  (reg_sz keys 
             PM                        &      environment variables)      
                                                                          
                                                                          
             Please respond to                                            
                   thin                                                   
                                                                          
                                                                          




Hi all,

I've researched this one briefly, using google, tweaking keywords, and
limiting search results by domain. (e.g. using site:microsoft.com)


Viewing the contents of the registry, the default key value is always
REG_SZ, and can't be changed.


On Windows 2003 Server, because the default value is REG_SZ, can you modify
a default value to include an environment variable?

   E.g Replacing "c:\documents and settings\administrator\recent" with
"%userprofile%\recent"



I have found Microsoft Knowledge Base articles which do state that to use
environment variables, you have to use the REG_EXPAND_SZ value type.
However I can't find a definitive answer to my question before I run any
tests.

Thanks!
Joe

Hazlewoods LLP - Chartered Accountants and Business Advisers

Offices in Cheltenham Tel 01242 237661, Gloucester Tel 01452 634800 and
Staverton Tel 01242 680000.

Members: Harvey Grove FCA FCCA Andrew Brookes FCA CF Jon Cartwright FCCA
ATII TEP Nick Dee ACA Tony Flambard FCCA David Granger FCA FCCA Jonathan
Harvie FCA David Main FCCA Christopher Mourton FCCA David Pierce FCA FCCA
Adrian Randle FCA FCCA TEP Graham Rew FCA Philip Swan FCA ATII Norman
Webber FCCA CF David Williams FCA

Website www.hazlewoods.co.uk.

Registered by the Institute of Chartered Accountants in England and Wales
to carry out company audit work.
Authorised and Regulated by the Financial Services Authority.
Registered in England. Partnership No: OC311817
************************************************************************
DISCLAIMER:
The contents of this Email and attachments are confidential to the ordinary
user(s) of the Email address(es) to which it was sent and may be legally
privileged.
Hazlewoods LLP accepts no responsibility for the content of this Email, or
the actions taken on the basis of the information provided, unless that
information is subsequently agreed in writing.
************************************************************************?I+R{n?&8z?Vj?jzzZ)zX?
 


#####################################################################################
This e-mail, including all attachments, may be confidential or privileged.  
Confidentiality or privilege is not waived or lost because this e-mail has been 
sent to you in error.  If you are not the intended recipient any use, 
disclosure or copying of this e-mail is prohibited.  If you have received it in 
error please notify the sender immediately by reply e-mail and destroy all 
copies of this e-mail and any attachments.  All liability for direct and 
indirect loss arising from this e-mail and any attachments is hereby disclaimed 
to the extent permitted by law.
#####################################################################################

Other related posts: