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


  1. Posts : 12
    Microsoft Windows 7 Ultimate 64-bit 7601 Multiprocessor Free Service Pack 1
       #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 Computer


  2. Posts : 12
    Microsoft Windows 7 Ultimate 64-bit 7601 Multiprocessor Free Service Pack 1
    Thread Starter
       #2

    Nevermind, apparently this can enable pointing to to a redirected profile:
    oShell.SpecialFolders
      My Computer


 

  Related Discussions
Our Sites
Site Links
About 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 18:57.
Find Us