Results 1 to 10 of 10
  1. #1
    3 Star Lounger
    Join Date
    Feb 2001
    Posts
    369
    Thanks
    2
    Thanked 1 Time in 1 Post

    List of %xxxx% global vars

    I'm struggling to find a list of the variables, such as %user%, %system% and %systemroot%. I can't seem to get my search strategy right.

    Does anyone know where such a list exists, and information about where these variables can be used (eg in office links?). I'm particularly hoping to find the correct name for what I could call %documents%

    thanks

    Mark

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    Cincinnati, Ohio, USA
    Posts
    7,089
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: List of %xxxx% global vars

    You can find the system-set variables by opening a command prompt and typing SET.

    Unfortunately, unless you want to write some VB code, I don't think you are going to have an easy time of finding the users' documents folders. The variables can be used in BAT files, scripts, and other system functions.....even at a standard Run prompt from time to time. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    -Mark

  3. #3
    3 Star Lounger
    Join Date
    Feb 2001
    Posts
    369
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: List of %xxxx% global vars

    Thanks Mark, but when I do this I don't see some of the variables I think I know exist, such as %user%.

    I don't have a problem with writing simple code, but mainly VBA rather than dealing with anything more OS. My main problem is in working on developing an Access db with linked tables on both the laptop and at work, where the My Documents path is different, but everything is the same below that.

    It sounds so simple.....which probably means it's impossible <img src=/S/sigh.gif border=0 alt=sigh width=15 height=15>.

  4. #4
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    Cincinnati, Ohio, USA
    Posts
    7,089
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: List of %xxxx% global vars

    I don't believe you're going to find a variable named USER unless you define it yourself. The variables that you see from the SET command are the globally set NT/2K/XP variables.

    You could have logic that defines USER=%username% for example - but in VBA you have other options as well.

    If your problem/solution is Access based, perhaps the Access forum would be a better place to post the question?
    -Mark

  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: List of %xxxx% global vars

    You can retrieve the user's logon name using the Windows Script Host and VBScript. See <!post=Post #130373,130373>Post #130373<!/post> for a code example.

    What are you trying to get at with %documents%? The Windows Script Host has a collection of Special Folders. I posted a VBA example for the current user's desktop in <!post=Post #117516,117516>Post #117516<!/post>. The other special folders are listed in: Windows Script Host: SpecialFolders Property on MSDN.

    Hope this helps.

  6. #6
    Star Lounger
    Join Date
    Jan 2002
    Location
    Suffolk, England
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: List of %xxxx% global vars

    If the root (ouch!) of the problem is developing Access, why not set up mapped drives for the linked tables? So long as you remember to use the 'mapped' route when making changes to the structure of the DB, it works very well.

  7. #7
    3 Star Lounger
    Join Date
    Feb 2001
    Posts
    369
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: List of %xxxx% global vars

    Sorry, I must have been mistaken.

    I will, of course, try the access boards now, but I remember coming across this problem before (of not being able to find a list of these variables), and always like to try for the global solution first <img src=/S/smile.gif border=0 alt=smile width=15 height=15>.

  8. #8
    3 Star Lounger
    Join Date
    Feb 2001
    Posts
    369
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: List of %xxxx% global vars

    Duh! Why didn't I think of that. My slice of the server pie at work is mapped to a drive at logon, so why not map the My Documents folder on the laptop to the same drive letter, and solve many problems whilst not interfering with the simplicity of my synchronisation programme.

    Thanks Bubs.

    BTW, how much "overhead" is involved in this (eg mapping My Documents to T?

  9. #9
    Star Lounger
    Join Date
    Jan 2002
    Location
    Suffolk, England
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: List of %xxxx% global vars

    <hr>BTW, how much "overhead" is involved in this (eg mapping My Documents to T?<hr>
    You could either create a folder for your DB (or in my case I created one for the back end of my DB), share it, then map that, or share your 'my docs', then map that, or create a logical partition on your laptop, and park 'my docs' there.

    The last will be the best 'proofing' against making links between the front and back end of your DB where Access thinks the mapping is the full file path rather than the mapped drive. (can't think how many times I made that mistake

    Right click the folder, create a new share, restrict the permssions so that the whole world cannot walk in, then go to my computer/tools/map drive. You may find you have to browse thru network neigbouthood to your own machine in order to find it

  10. #10
    3 Star Lounger
    Join Date
    Feb 2001
    Posts
    369
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: List of %xxxx% global vars

    Thanks, I think I'll go for B: only got 6GB HD in laptop, and won't split db until devpt finished, when it's not so much of an issue.

    Never have been good at the simple answer. Thanks

Posting Permissions

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