Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: How do I enable %UserProfile% for scripting with Folder Redirection?

23 Feb 2013   #1

Microsoft Windows 7 Ultimate 64-bit 7601 Multiprocessor Free Service Pack 1
How do I enable %UserProfile% for scripting with Folder Redirection?

I'm experimenting with Folder Redirection and after getting it set up, I quickly realized that any VBS scripts that have environmental variables such as %UserProfile% become unusable.
A simple example:

 C:\CD %UserProfile%\Desktop

'Place to deposit excel output file
Depo=oShell.ExpandEnvironmentStrings("%userprofile%" & "\Desktop\Folder_This_User_Needs_Easy_Access_To\")
if not objfso.folderexists(Depo) then
end if
These no longer work when using Folder Redirection. I'm hoping there is a work around for this because a lot of my existing scripts depend on this variable remaining valid. Any help is appreciated. Thanks!

My System SpecsSystem Spec
23 Feb 2013   #2

Microsoft Windows 7 Ultimate 64-bit 7601 Multiprocessor Free Service Pack 1

Nevermind, apparently this can enable pointing to to a redirected profile:
My System SpecsSystem Spec

 How do I enable %UserProfile% for scripting with Folder Redirection?

Thread Tools

Similar help and support threads
Thread Forum
Folder redirection messed it all up! HELP!!
I had a GPO that I was testing with my account (folder redirection). I mistakenly deleted the GPO completely. Now, my computer, every time that I login trys to connect to that path which no longer exists. So, every time I login it says windows cannot find \\servername\sharename. When I right click...
Network & Sharing
Desktop folder redirection
I am running Active Directory on Server 2008 and redirecting My Documents, Favorites, and Desktop folders to the server. When the PCs go a screen saver and the user needs to login they loose connection to their Desktop icons. Their My Documents, Favorites and all mapped drives all work fine, they...
Network & Sharing
Folder Redirection.
Hi all, Dont know if you can help... We have been running folder redirection, Redirecting users My Documents path only. We used to have users my documents pointed to NAS001 however we are now pointing this to a totally different hostname. We have moved the files across with permissions and...
Network & Sharing
Folder redirection
Hi. I work in a high school and this year we moved to Win7 Pro from Xp. In the past we have made a lot of folder redirection. Desktops and Startmenus are redirected to certain shares to provide students with locked down desktops and startmenus. We also redict user folders such as My Documents, My...
Network & Sharing
Folder Redirection Problem
I successfully created a partition D: to hold my media files. I wanted to use folder redirection to move My Music, Videos, and My Pictures to the D: drive. Starting with Videos folder, I changed it from C:\Users\Pestoman\Videos to D:\ The problem is that I changed it to D:\ instead of D:\Videos....
General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 20:49.
Twitter Facebook Google+