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
eblip

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:

Code:
 C:\CD %UserProfile%\Desktop
And

Code:
'Place to deposit excel output file
Depo=oShell.ExpandEnvironmentStrings("%userprofile%" & "\Desktop\Folder_This_User_Needs_Easy_Access_To\")
if not objfso.folderexists(Depo) then
objFSO.CreateFolder(Depo)
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
eblip

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

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

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




Thread Tools




Similar help and support threads
Thread Forum
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
Windows 7 client changes folder redirection UNC path
Hello everyone, I've got Server 2008 (no R2) running as a PDC for my small LAN. The clients are an XP SP2 Pro laptop, a 7 Pro laptop and the server itself. I created a folder redirection policy to keep the roaming profiles V1 and V2 in sync, so e.g. "V2\Start Menu" points to "V1\Start...
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
my documents folder redirection
not sure where this thread should belong so i will dump it here...HI ALL 1st post. with our xp users we right click and redirect the location of their my documents folder to a network location. this can also be done by group policy that much i have figured out....but in xp there is an "easy"...
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 13:09.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App