We have our My Documents folder redirected to a network share using
group policies. The network share is different depending upon which
OU the user is located. I am creating one script for all users and
this script needs to be able to determine the location of the
redirected My Documents. How can I do this? Is there an environment
variable which will tell me the location of the redirected My
Documents? I can not hard code this into the code because it is a
different location for different users.

Re: Folder Redirection and VBScript by Michael

Michael
Wed Jan 21 21:31:45 CST 2004

Shawnmd wrote:
> We have our My Documents folder redirected to a network share using
> group policies. The network share is different depending upon which
> OU the user is located. I am creating one script for all users and
> this script needs to be able to determine the location of the
> redirected My Documents. How can I do this? Is there an environment
> variable which will tell me the location of the redirected My
> Documents? I can not hard code this into the code because it is a
> different location for different users.


Doesn't this work?

set shell = createobject("wscript.shell")
MyDocumentsPath = shell.specialfolders("mydocuments")
msgbox MyDocumentsPath


--
Michael Harris
Microsoft.MVP.Scripting

Windows 2000 Scripting Guide
Microsoft® Windows®2000 Scripting Guide
http://www.microsoft.com/technet/scriptcenter/scrguide/sagsas_overview.asp

TechNet Script Center Sample Scripts
http://www.microsoft.com/downloads/release.asp?ReleaseID=38942

WSH 5.6 documentation download
http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en