Last Updated |
Click a heading below to reveal the tips.
See help on customising and using reg files.
This registry file will hide My Documents and disable some programs from starting their File Save As and File Open dialogs in My Documents.
The keys only are required to be present.
The standard behaviour of the File Save As and File Open dialogs (if the program doesn't override this) is to open the current folder for that program if there are files with the programs default extension in it, else to start in My Documents.
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Documents] "DisableStartInMyDocs"=dword:0001 "HideMyDocsFolder"="anything"
To restore My Documents to the Desktop type this command in the Start - Run dialog box.
rundll32 mydocs.dll,RestoreMyDocsFolder
To reenable Saving in My Documents type the following in RegDelete available on the help page.
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Documents\DisableStartInMyDocs
To change the location of the My Documents Folder use this reg file. This is the same as right clicking and choosing Properties.
REGEDIT4 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders] "Personal"="C:\\My Documents\\serenity web" [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders] "Personal"="C:\\My Documents\\serenity web"
To add Find to the right click menu for My Documents.
REGEDIT4 [HKEY_CLASSES_ROOT\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}\shell\find\ddeexec] "NoActivateHandler"="" @="[FindFolder(\"%l\", %I)]" [HKEY_CLASSES_ROOT\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}\shell\find\ddeexec\application] @="Folders" [HKEY_CLASSES_ROOT\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}\shell\find\ddeexec\topic] @="AppProperties" [HKEY_CLASSES_ROOT\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}\shell\find\command] @="C:\\WINDOWS\\Explorer.exe"
This adds a command to backup My Documents and all sub folders using PKZip for Dos version 2.5. You must use version 2.5 to backup long file names.
The example below assumes PKZip is in a directory in the path (or Windows, Command, or System) and backs it up to multiple floppies.
REGEDIT4 [HKEY_CLASSES_ROOT\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}\Shell\Backup\Command] @="pkzip.exe -ex -&fuv -r a:\\backup %1\\*.*"
This example assumes PKZip is in a directory called C:\pkware dir and is being backed up to a file called C:\backupdir\backupfilename.zip. The file names here are enclosed in inverted commas in case they have spaces in them. The program switches have also changed so the drive isn't formatted, verified, and using multiple floppies. Type pkzip /? to see valid switches.
Remember in a reg file an inverted comma is shown as \" and a backslash as \\.
REGEDIT4 [HKEY_CLASSES_ROOT\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}\Shell\Backup\Command] @="\"C:\\pkware\\pkzip.exe\" -ex -r \"C:\\backupdir\\backupfilename\" %1\\*.*"
To add My Documents folder to the list in the File Types tab in Folder Options use this reg file.
REGEDIT4 [HKEY_CLASSES_ROOT\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}] "EditFlags"=hex:02,00,00,00
This reg file is the default icon for the My Document folder. The first parameter is the name of a file containing icons, such as icon files (.ico) or executable files (.exe, .dll, & .cpl). The second is the icon in the file to use. Bitmaps (.bmp) made with MSPaint can also be used, in which case omit the icon index.
REGEDIT4 [HKEY_CLASSES_ROOT\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}\DefaultIcon] @="mydocs.dll,0"
To edit the name or pop up tip use this reg file.
REGEDIT4 [HKEY_CLASSES_ROOT\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}] @="My Documents" "InfoTip"="Stores your documents, graphics, and other files."
To add items to the right click menu to items in My Documents only add to HKEY_CLASSES_ROOT\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}\AllSpecialItems.
To restore if hidden
rundll32 mydocs.dll,RestoreMyDocsFolder
To repair
regsvr32 mydocs.dll
If the registry entries for My Documents get out of sync then it may not be possible to use the My Documents icon with out a crash or changes to the path don't actually change.
This script file fixes this problem
'SetMyDocs.vbs 'Set the path to My Documents. 'Used when User Shell Folder\Personal is blank (the UI doesn't accept changes) ' 'Serenity Macros https://www.angelfire.com/biz/serenitymacros 'David Candy davidc@sia.net.au ' On Error Resume Next strExplain="SetMyDocs displays and changes the My Documents path." & vbCRLF & "Used when their is a blank value for Personal in the User Shell Folders key" & vbCRLF & vbCRLF strTitle="Set MyDocuments Path" Dim Sh Set Sh = WScript.CreateObject("WScript.Shell") ReportErrors "Creating Shell" MyDocsPath1=Sh.RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Personal") MyDocsPath2=Sh.RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Personal") If Err.Number=-2147024894 then Err.Clear If MsgBox (strExplain & "Shell Folders" & vbtab & MydocsPath1 & vbCRLF & "User Shell Folders" & vbtab & MydocsPath2 & vbCRLF & vbCRLF & "Continue?", vbYesNo + vbInformation, strTitle) = 6 then Dim bffShell Dim bff Set bffShell = WScript.CreateObject("Shell.Application") Set bff = bffShell.BrowseForFolder(0, "Select the My Documents folder", 1) If Err.number<>0 Then ReportErrors("Setting up Browse for Folder") Else A = bff.ParentFolder.ParseName(bff.Title).Path If err.number=424 then err.clear End If If A<>"" then Sh.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Personal", A Sh.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Personal", A If Err.number<>0 Then ReportErrors("Writing to the registry") Else MsgBox "My Documents folder has been changed to " & A & vbCRLF & vbCRLF & "Edit the path of the My Documents folder by right clicking the icon and choosing properties. Windows may need to be restarted before the My Documents icon works properly.", vbInformation, strTitle End If Else MsgBox "A blank value was entered or the dialog box was canceled, no changes made", vbInformation, strTitle End If End If ReportErrors "SettingPath" VisitSerenity Sub ReportErrors(strModuleName) If err.number<>0 then Msgbox "Error occured in " & strModuleName & " module of " & err.number& " - " & err.description & " type" , vbCritical + vbOKOnly, "Something unexpected" Err.clear End Sub Sub VisitSerenity If MsgBox("This program came from the Serenity Macros Web Site" & vbCRLF & vbCRLF & "Would you like to visit Serenity's Web Site now?", vbQuestion + vbYesNo + vbDefaultButton2, "Visit Serenity Macros") =6 Then sh.Run "http:\\www.angelfire.com\biz\serenitymacros" End If End Sub