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

eblip

New member
Local time
2:09 AM
Messages
12
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 Computer

OS
Microsoft Windows 7 Ultimate 64-bit 7601 Multiprocessor Free Service Pack 1
CPU
AMD Phenom(tm) II X6 1045T Processor
Motherboard
ASRock 970 Extreme3
Memory
8.00 GB
Graphics Card(s)
AMD Radeon HD 6800 Series
Sound Card
(1) AMD High Definition Audio Device (2) Realtek High Defi
Screen Resolution
1280 x 1024 x 32 bits (4294967296 colors) @ 60 Hz
Hard Drives
(1) OCZ-AGILITY3 ATA Device (2) ST3160815AS ATA Device
Nevermind, apparently this can enable pointing to to a redirected profile:
oShell.SpecialFolders
 

My Computer

OS
Microsoft Windows 7 Ultimate 64-bit 7601 Multiprocessor Free Service Pack 1
CPU
AMD Phenom(tm) II X6 1045T Processor
Motherboard
ASRock 970 Extreme3
Memory
8.00 GB
Graphics Card(s)
AMD Radeon HD 6800 Series
Sound Card
(1) AMD High Definition Audio Device (2) Realtek High Defi
Screen Resolution
1280 x 1024 x 32 bits (4294967296 colors) @ 60 Hz
Hard Drives
(1) OCZ-AGILITY3 ATA Device (2) ST3160815AS ATA Device
Back
Top