问题
We use Folder Redirection at my work, and I'm trying to simplify a script that runs when users log on to a Terminal Server.
Is there a way, through SpecialFolders
, to access the Application Data
folder?
I ask because if we have to move the location of the Folder Redirection (due to storage limitations), I'd rather not have to go through scripts and manually change things.
Set objShell = WScript.CreateObject("WScript.Shell")
desktop_location = objShell.SpecialFolders.Item("Desktop")
quick_launch_location = "\\videss\TSUsers\" & user_name & "\Application Data\Microsoft \Internet Explorer\Quick Launch\"
回答1:
You could use the environment variable
Set objShell = CreateObject( "WScript.Shell" )
appDataLocation=objShell.ExpandEnvironmentStrings("%APPDATA%")
quick_launch_location = appDataLocation & "\Microsoft\Internet Explorer\Quick Launch\"
来源:https://stackoverflow.com/questions/18781992/access-the-application-data-folder-when-using-folder-redirection