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:

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

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 for2: How do I enable %UserProfile% for scripting with Folder Redirection?
Thread Forum
Offline files + Folder redirection Network & Sharing
Desktop folder redirection Network & Sharing
Windows 7 client changes folder redirection UNC path Network & Sharing
Folder Redirection. Network & Sharing
Folder redirection Network & Sharing
Folder Redirection Problem General Discussion
my documents folder redirection 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 09:33 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33