Script for Setting Folder Options - Win 7?
Anyone know of a way to script the settings in folder options -> View in Win7?
ie. Uncheck Hide Extensions for known file types, uncheck Use Sharing Wizard, etc.
Preferably it would set all folders to be viewed as Details as well.....
ie. Uncheck Hide Extensions for known file types, uncheck Use Sharing Wizard, etc.
Preferably it would set all folders to be viewed as Details as well.....
0 Comments
[ + ] Show comments
Answers (11)
Please log in to answer
Posted by:
dyehardfan
13 years ago
Yeah, that's the track I am on right now. As far as I can tell these are the reg keys I will need to modify:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\HideFileExt
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\SharingWizardOn
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\AutoCheckSelect
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\HideFileExt
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\SharingWizardOn
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\AutoCheckSelect
ORIGINAL: Thegunner
Probably would guess you need to change registery settings.ÂÂ
Posted by:
dyehardfan
13 years ago
Option Explicit
Dim objShell, FileExt, SharWiz, CheckBox, strModify, strDelete
FileExt = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\HideFileExt\DefaultValue"
SharWiz = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\SharingWizardOn\DefaultValue"
CheckBox= "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\AutoCheckSelect\DefaultValue"
Set objShell = CreateObject("WScript.Shell")
strModify = objShell.RegWrite(FileExt,"00000000","REG_DWORD")
strModify = objShell.RegWrite(SharWiz,"00000000","REG_DWORD")
strModify = objShell.RegWrite(CheckBox,"00000000","REG_DWORD")
Wscript.Quit
hmmm.....making these changes in HKLM seems to have no effect. If I make the changes in HKCU it will work, but only for that user. Was hoping I wouldn't have to make this a login script....
Anybody have any thoughts?
Posted by:
squeakstar
13 years ago
Posted by:
dyehardfan
13 years ago
ORIGINAL: squeakstar
preset default profiles at OS image creation or mandatory user profiles users can't change. i can't think of any other point of contact with the user's account to enforce these other than a login script... would be interested to know though if anyone comes up with summat else...
I appreciate the confirmation on that. I am going to attempt to use the following login script int he AllUsersStartup folder:
Option Explicit
Dim objShell, FileExt, SharWiz, CheckBox, strModify, strDelete, objDesktop
FileExt = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt"
SharWiz = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\SharingWizardOn"
CheckBox= "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\AutoCheckSelect"
Set objShell = CreateObject("WScript.Shell")
objDesktop = objShell.SpecialFolders("Desktop")
strModify = objShell.RegWrite(FileExt,"00000000","REG_DWORD")
strModify = objShell.RegWrite(SharWiz,"00000000","REG_DWORD")
strModify = objShell.RegWrite(CheckBox,"00000000","REG_DWORD")
objShell.AppActivate objDesktop
objShell.SendKeys "{F5}"
Wscript.Quit
Why in the world MS decided to default to Check Boxes is beyond my comprehension...
Posted by:
squeakstar
13 years ago
Cool dude - i personally take a slightly different route - mainly because i'm a simpleton script kiddy
and add reg entries into the text file userReg.reg which would look something like this to set some default paths for a bit of software we use:-
REM import registry settings for default LSS folders and Legend file
regedit /s "\\ServerShare01\RegSettings\userReg.reg"
and add reg entries into the text file userReg.reg which would look something like this to set some default paths for a bit of software we use:-
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\LSS\New Survey]
"Prototype"="L:\\LEGENDV9\\GEO_LEGEND_V9_2010.LSS"
[HKEY_CURRENT_USER\Software\LSS\New Survey]
"Prototype"="L:\\LEGENDV9\\GEO_LEGEND_V9_2010.LSS"
[HKEY_CURRENT_USER\Software\LSS\Directories]
"Survey"="C:\\Surveys"
"XDF"="L:\\XDF"
"ADF"="L:\\ADF"
"PDF"="L:\\PDF"
"SDF"="L:\\SDF"
"TDF"="L:\\TDF"
"CNV"="L:\\CNV"
"Textures"="L:\\TXR"
"Tutorials"="K:\\Tutorials"
Posted by:
dyehardfan
13 years ago
Yeah, I knew next to nothing when I took this job, but have been forced to learn a bit. It's fun, in a masochistic sort of way.
Just wish I could find a way to do this on a per machine basis and not per user....
Just wish I could find a way to do this on a per machine basis and not per user....
ORIGINAL: squeakstar
Cool dude - i personally take a slightly different route - mainly because i'm a simpleton script kiddy
REM import registry settings for default LSS folders and Legend file
regedit /s "\\ServerShare01\RegSettings\userReg.reg"
and add reg entries into the text file userReg.reg which would look something like this to set some default paths for a bit of software we use:-
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\LSS\New Survey]
"Prototype"="L:\\LEGENDV9\\GEO_LEGEND_V9_2010.LSS"
[HKEY_CURRENT_USER\Software\LSS\New Survey]
"Prototype"="L:\\LEGENDV9\\GEO_LEGEND_V9_2010.LSS"
[HKEY_CURRENT_USER\Software\LSS\Directories]
"Survey"="C:\\Surveys"
"XDF"="L:\\XDF"
"ADF"="L:\\ADF"
"PDF"="L:\\PDF"
"SDF"="L:\\SDF"
"TDF"="L:\\TDF"
"CNV"="L:\\CNV"
"Textures"="L:\\TXR"
"Tutorials"="K:\\Tutorials"
Posted by:
dyehardfan
13 years ago
Posted by:
Lucid
13 years ago
For new machines all you should have to do is edit the default user profile. If you want to make the change for existing profiles, you'd have to load their registry hives and make the changes there as well. And if you think about it, it sort of makes sense that there's no machine-wide setting for some of these; because you don't want UserX making a change that adjusts the visual interface for UserY. Otherwise you'd get some very cranky people. Anyway, here's a rough snippet of code that might help you as a novice:
strAllUsersDesktopPath = objWshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Common Desktop")
' Attempts to configure Windows 2000/XP paths.
strUserProfilesMainFolder = Mid(strAllUsersDesktopPath,1,InStr(strAllUsersDesktopPath, "\All Users"))
If strUserProfilesMainFolder = "" Then
' Attempts to configure Windows Vista/7 paths.
strUserProfilesMainFolder = Mid(strAllUsersDesktopPath,1,InStr(strAllUsersDesktopPath, "\Public"))
End If
'Load the Default User profile registry hive
objWshShell.Run ("reg.exe load HKEY_USERS\CustomizeDefaultUserProfile """ & strUserProfilesMainFolder & "Default User\NTuser.dat"""), 0, True
'Set the registry key to turn off the Hidden File Extension folder option
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt", "0","REG_DWORD"
'Set the registry key to remove the highlighting of new applications in the Start menu
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_NotifyNewApps", "0","REG_DWORD"
'Unload the Default User profile registry hive
objWshShell.Run ("reg.exe unload HKEY_USERS\CustomizeDefaultUserProfile"), 0, True
And yes, there's no error checking or anything in this, and there are other ways to do this same thing - and you'd probably need more code if you're trying to adjust 64-bit Windows.
' Attempts to configure Windows 2000/XP paths.
strUserProfilesMainFolder = Mid(strAllUsersDesktopPath,1,InStr(strAllUsersDesktopPath, "\All Users"))
If strUserProfilesMainFolder = "" Then
' Attempts to configure Windows Vista/7 paths.
strUserProfilesMainFolder = Mid(strAllUsersDesktopPath,1,InStr(strAllUsersDesktopPath, "\Public"))
End If
'Load the Default User profile registry hive
objWshShell.Run ("reg.exe load HKEY_USERS\CustomizeDefaultUserProfile """ & strUserProfilesMainFolder & "Default User\NTuser.dat"""), 0, True
'Set the registry key to turn off the Hidden File Extension folder option
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt", "0","REG_DWORD"
'Set the registry key to remove the highlighting of new applications in the Start menu
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_NotifyNewApps", "0","REG_DWORD"
'Unload the Default User profile registry hive
objWshShell.Run ("reg.exe unload HKEY_USERS\CustomizeDefaultUserProfile"), 0, True
And yes, there's no error checking or anything in this, and there are other ways to do this same thing - and you'd probably need more code if you're trying to adjust 64-bit Windows.
Posted by:
dyehardfan
13 years ago
Yeah, that definitely put me on the right track. I guess when I was saying on a "per machine basis" I wasn't accurately describing what I was trying to do. Making the changes to the Default User's profile does 99% of what I need this to do. Here is the code I am using at the moment, based off of what you had and some digging around I did for other changes I wanted to make:
I want to make some changes to the Local Administrator Account as well, can that be done loading that User Account's nt.dat file as well, or would I be better off with my former method above?
Set objWshShell = WScript.CreateObject("WScript.Shell")
strAllUsersDesktopPath = objWshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Common Desktop")
' Attempts to configure Windows 2000/XP paths.
strUserProfilesMainFolder = Mid(strAllUsersDesktopPath,1,InStr(strAllUsersDesktopPath, "\All Users"))
If strUserProfilesMainFolder = "" Then
' Attempts to configure Windows Vista/7 paths.
strUserProfilesMainFolder = Mid(strAllUsersDesktopPath,1,InStr(strAllUsersDesktopPath, "\Public"))
End If
'Load the Default User profile registry hive
objWshShell.Run ("reg.exe load HKEY_USERS\CustomizeDefaultUserProfile """ & strUserProfilesMainFolder & "Default User\NTuser.dat"""), 0, True
'Set the registry key to turn off the Hidden File Extension folder option
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt", "0","REG_DWORD"
'Set the registry key to turn off the Sharing Wizard folder option
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\SharingWizardOn", "0","REG_DWORD"
'Set the registry key to turn off Use Check Boxes to Select Items
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\AutoCheckSelect", "0","REG_DWORD"
'Set the registry key to remove Default Programs from the Start Menu
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_ShowSetProgramAccessAndDefaults", "0","REG_DWORD"
'Set the registry key to Show Recent Documents in the Start Menu
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_ShowRecentDocs", "1","REG_DWORD"
'Set the registry key to Hide My Music from the Start Menu
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_ShowMyMusic", "0","REG_DWORD"
'Set the registry key to Hide My Games from the Start Menu
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_ShowMyGames", "0","REG_DWORD"
'Set the registry key to Show Downloads on the Start Menu
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_ShowDownloads", "0","REG_DWORD"
'Set the registry key to Hide My Pictures from the Start Menu
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_ShowMyPics", "0","REG_DWORD"
'Set the Control Panel View to Small Icons
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\StartupPage", "1","REG_DWORD"
'Show My Computer on All User's Desktop
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel\{20D04FE0-3AEA-1069-A2D8-08002B30309D}", "0","REG_DWORD"
'Unload the Default User profile registry hive
objWshShell.Run ("reg.exe unload HKEY_USERS\CustomizeDefaultUserProfile"), 0, True
I want to make some changes to the Local Administrator Account as well, can that be done loading that User Account's nt.dat file as well, or would I be better off with my former method above?
Posted by:
dyehardfan
13 years ago
Ok, this is my semi-final product. Again thanks for the tip on loading the default users registry hive.
dim strAllUsersDesktopPath, strUserProfilesDefaultFolder, strUserProfilesAdminFolder, strFileExt, strSharWiz, strCheckBox
dim objWshShell
Set objWshShell = WScript.CreateObject("WScript.Shell")
strAllUsersDesktopPath = objWshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Common Desktop")
' Attempts to configure Windows 2000/XP paths.
strUserProfilesDefaultFolder = Mid(strAllUsersDesktopPath,1,InStr(strAllUsersDesktopPath, "\All Users"))
If strUserProfilesDefaultFolder = "" Then
' Attempts to configure Windows Vista/7 paths.
strUserProfilesDefaultFolder = Mid(strAllUsersDesktopPath,1,InStr(strAllUsersDesktopPath, "\Public"))
End If
'Load the Default User profile registry hive
objWshShell.Run ("reg.exe load HKEY_USERS\CustomizeDefaultUserProfile """ & strUserProfilesDefaultFolder & "Default User\NTuser.dat"""), 0, True
'Set the registry key to turn off the Hidden File Extension folder option
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt", "0","REG_DWORD"
'Set the registry key to turn off the Sharing Wizard folder option
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\SharingWizardOn", "0","REG_DWORD"
'Set the registry key to turn off Use Check Boxes to Select Items
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\AutoCheckSelect", "0","REG_DWORD"
'Set the registry key to remove Default Programs from the Start Menu
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_ShowSetProgramAccessAndDefaults", "0","REG_DWORD"
'Set the registry key to Show Recent Documents in the Start Menu
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_ShowRecentDocs", "1","REG_DWORD"
'Set the registry key to Hide My Music from the Start Menu
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_ShowMyMusic", "0","REG_DWORD"
'Set the registry key to Hide My Games from the Start Menu
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_ShowMyGames", "0","REG_DWORD"
'Set the registry key to Show Downloads on the Start Menu
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_ShowDownloads", "0","REG_DWORD"
'Set the registry key to Hide My Pictures from the Start Menu
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_ShowMyPics", "0","REG_DWORD"
'Set the Control Panel View to Small Icons
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\StartupPage", "1","REG_DWORD"
'Show My Computer on All User's Desktop
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel\{20D04FE0-3AEA-1069-A2D8-08002B30309D}", "0","REG_DWORD"
'Show On Screen Keyboard on Right Side of Screen
objWshShell.RegWrite "HKEY_USERS\CustomizeDefaultUserProfile\Software\Microsoft\TabletTip\1.7\EdgeTargetOnLeft", "0","REG_DWORD"
'Unload the Default User profile registry hive
objWshShell.Run ("reg.exe unload HKEY_USERS\CustomizeDefaultUserProfile"), 0, True
'Make Changes to the Installation (Administrator) Account
'Set the registry key to turn off the Hidden File Extension folder option
objWshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt", "0","REG_DWORD"
'Set the registry key to turn off the Hidden File Extension folder option
objWshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt", "0","REG_DWORD"
'Set the registry key to turn off the Sharing Wizard folder option
objWshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\SharingWizardOn", "0","REG_DWORD"
'Set the registry key to turn off Use Check Boxes to Select Items
objWshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\AutoCheckSelect", "0","REG_DWORD"
'Set the registry key to Show Downloads on the Start Menu
objWshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_ShowDownloads", "0","REG_DWORD"
'Set the registry key to Hide My Pictures from the Start Menu
objWshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_ShowMyPics", "0","REG_DWORD"
'Set the Control Panel View to Small Icons
objWshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\StartupPage", "1","REG_DWORD"
'Show My Computer on Desktop
objWshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel\{20D04FE0-3AEA-1069-A2D8-08002B30309D}", "0","REG_DWORD"
'Show On Screen Keyboard on Right Side of Screen
objWshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\TabletTip\1.7\EdgeTargetOnLeft", "0","REG_DWORD"
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.