Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBS equivalent for %USERPROFILE%?

Status
Not open for further replies.

jdukarm

IS-IT--Management
Jul 15, 2004
21
GB
The %USERPROFILE% used in .bat for the profile they are using on the computer so I can copy a normal.dot file and an outlook otm file to the specific profiles on login using WSH script.

Is there an equivalent for it in vbs or wsh?

Rewriting my scripts in vbs and this is the only thing that has stumped me.

Thanks John
 
There are a couple of possibilities. The ExpandEnvironmentStrings method of the WshShell object will let you access the environment. The SpecialFolders collection of the same object may give you the directory you want as well.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
You may take a look at he WshShell.Environment collections.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Think its the HOMEPATH. Not sure though.

Thanks John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top