Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to set a system environment variable to use use the current logged in username. I'm tried the below using the username environment variable but it doesn't work. I'm using "setx /m" on windows 7 64bit to set the variable but they aren't being set to the current logged in user.

  • User_Network_Workspace = \network.share\Staff\%USERNAME%\workspace
  • User_Network_Pocation = \network.share\Staff\%USERNAME%\pkg

Is what I'm doing possible or is there an alternative. Essentially what I want is the ability to have an environment variable for every user that logs in to point to there staff folder.

Thanks in advance.

share|improve this question

migrated from stackoverflow.com Jan 12 '13 at 15:15

This question came from our site for professional and enthusiast programmers.

    
System environment variables are not expanded recursively. You'll need to use group policy, or a logon script or similar. –  Harry Johnston Jan 9 '13 at 3:18
    
Cheers, looks like I'll need to modify my log on script. If I had Windows Server 2008 then it would be a lot easier technet.microsoft.com/en-us/library/cc772047.aspx –  MarcusMaximus Jan 11 '13 at 5:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.