Access the 'Application Data' folder when using Folder Redirection

江枫思渺然 提交于 2019-12-08 18:01:56

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!