Results 1 to 3 of 3
  1. #1
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have a .REG file which can write this key/value to the registry:
    Code:
    [HKEY_CURRENT_USER\Software\SomeProg]
    "LastUsed"="C:\\Documents and Settings\\AlanR\\My Documents\\SomeProg\\sample.abc"
    I'm wondering if it's possible to make this more "generic" by using the environment variable:
    Code:
    USERPROFILE=C:\Documents and Settings\AlanR
    so that the reg file reads:
    Code:
    "LastUsed"="%USERPROFILE%\\My Documents\\SomeProg\\sample.abc"
    and if it is possible, where do the quotes, slashes and %s (single or double?) go?

    Alan

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    "LastUsed"="%USERPROFILE%\\My Documents\\SomeProg\\sample.abc"

    is correct.

  3. #3
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='779522' date='12-Jun-2009 22:18']"LastUsed"="%USERPROFILE%\\My Documents\\SomeProg\\sample.abc"

    is correct.[/quote]

    Cheers Hans!


    Alan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •