![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | How to apply changes to "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Personal" (My Document)? I developed a small script that changes the key relative to "My Documents" folder AFTER the user logon. It is a win2003 server with citrix metaframe, so many user are connected at the same time (that's why i have to get the right explorer pid to kill) I noticed that after changing this key, the actual folder pointed by "My Documents" is not affected unless the user log off and then back on. Another way to apply the change, beside logging off/on, is to kill "explorer.exe" and run it again. This is the code: Dim WSHShell Set WSHShell = CreateObject("WScript.Shell") strComputer = "." Set objWMIService = GetObject("winMgmts:\\localhost") Set colItems = objWMIService.ExecQuery("Select * From Win32_Process where Name='explorer.exe'") Dim strUserName, strDomain, pid, base base=WScript.Arguments.Item(0) For Each objItem in colItems objItem.GetOwner strUser, strDomain If (strUser=WSHShell.ExpandEnvironmentStrings("%USERNAME%")) Then pid=objItem.ProcessID End If Next WSHShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Personal", "w:\firma\"& base WSHShell.Run "taskkill /pid "&pid&" /f" WSHShell.Run "explorer.bat" 'runs explorer.exe But i would like to find a way to apply this change without such brutal killing.. anyone has an idea on how doing this? Thank you for your consideration! |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Personal User Shell Folders | Tutorials | |||
| Personal User Shell Folders - Move Location | Tutorials | |||
| Personal folders show "Small Icons" view | Vista file management | |||
| Windows Explorer: How to force ALL folders to use "All Items" template rather than "Pictures & Videos" | Vista General | |||
| "User's Files" folder and Shell Folders like Documents, Desktop, M | Vista General | |||