Diana (Cda) Posted October 2, 2007 Share Posted October 2, 2007 (edited) Is there a control or command that will allow us to toggle showing or hiding files, as seen in Windows Explorer folder options where we can tick to hide or show hidden files/folders? I found again just references to doing things reglated to GUIs in the help file and got a whole bunch of other things when searching the forum. Thanks. p.s., my internet has been down since Friday so I'll not be able to read this post and answer again until tomorrow morning when I get back to work. Thanks much!!! <g> Edited October 2, 2007 by Diana (Cda) Link to comment Share on other sites More sharing options...
MrCreatoR Posted October 2, 2007 Share Posted October 2, 2007 Hi,Check this topic. Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
Nahuel Posted October 3, 2007 Share Posted October 3, 2007 (edited) Hi, Check this topic.Boo I was making one but took too long I couldn't figure out a way to refresh the explorer windows! haha, thanks for that post! This is what I came up with: expandcollapse popupFunc ToggleHiddenFiles($ToggleHidden=1,$ToggleSuperHidden=1,$ToggleFileExt=0) $RegKey="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" $Hidden=RegRead($RegKey,"Hidden") $HideFileExt=RegRead($RegKey,"HideFileExt") $ShowSuperHidden=RegRead($RegKey,"ShowSuperHidden") If $ToggleHidden=1 Then If $Hidden=1 Then RegWrite($RegKey,"Hidden","REG_DWORD",2);=2 hide,=1 show Else RegWrite($RegKey,"Hidden","REG_DWORD",1);=2 hide,=1 show EndIf EndIf If $ToggleSuperHidden=1 Then If $ShowSuperHidden=1 Then RegWrite($RegKey,"ShowSuperHidden","REG_DWORD",0);=0 hide, 1 show Else RegWrite($RegKey,"ShowSuperHidden","REG_DWORD",1);=0 hide, 1 show EndIf EndIf If $ToggleFileExt=1 Then If $HideFileExt=1 Then RegWrite($RegKey,"HideFileExt","REG_DWORD",0);=0 show, 1 hide Else RegWrite($RegKey,"HideFileExt","REG_DWORD",1);=0 show, 1 hide EndIf EndIf ;Get explorer windows: Opt("WinTitleMatchMode", 4) $WinList = WinList("classname=CabinetWClass") If IsArray($WinList) Then Local $WinListArr[$WinList[0][0]+1] For $iW = 1 To $WinList[0][0] $WinListArr[$iW] = $WinList[$iW][0] Next $WinListArr[0] = $WinList[0][0] ;~ Return $WinListArr Else ;~ Return "" EndIf ;Update explorers: $WinExpListArr =$WinListArr If IsArray($WinExpListArr) Then For $iWin = 1 To $WinExpListArr[0] $GetWinState = WinGetState($WinExpListArr[$iWin]) $Hwnd = WinGetHandle($WinExpListArr[$iWin]) DllCall("user32.dll", "long", "SendMessage", "hwnd", $hWnd, "int", 0x111, "int", 28931, "int", 0) Next EndIf $Hwnd = WinGetHandle("classname=Progman") DllCall("user32.dll", "long", "SendMessage", "hwnd", $hWnd, "int", 0x111, "int", 28931, "int", 0) EndFunc This is how you use it: ToggleHiddenFiles([ToggleHidden=1,[ToggleSuperHidden=1,[ToggleHideFileExtensios=0]]]) The three parameters are optional. Leaving them blank will toggle:*Hidden files*SuperHidden filesFor example, let's say you just want to toggle hidden file extensions, then you just use: ToggleHiddenFiles(0,0,1) If you just want to toggle hidden system files (superhiddenfiles) then use: ToggleHiddenFiles(0,1,0) Thanks MsCreatoR Edited October 3, 2007 by Nahuel Link to comment Share on other sites More sharing options...
GEOSoft Posted October 3, 2007 Share Posted October 3, 2007 (edited) Nice work Nahuel Now can you figure out how to show the super-super-super hidden files. I always run with super-hidden enabled but I have at least 2 files that will not show regardless. I know they exist because I can Run or ShellExecute them an I looked in the registry to check the paths and they are right where I knew they were. BTW it would be a good idea to make sure that the values are the same for both before you toggle. t's no good having The value of Hidden = 0 and then the value of SuperHidden = 1 Edited October 3, 2007 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Nahuel Posted October 3, 2007 Share Posted October 3, 2007 Nice work NahuelNow can you figure out how to show the super-super-super hidden files.I always run with super-hidden enabled but I have at least 2 files that will not show regardless.I know they exist because I can Run or ShellExecute them an I looked in the registry to check the paths and they are right where I knew they were.Well, if you go to folder options, then view and then Hide protected operating system files (Recommended) . You'll see that it modifies the value of ShowSuperHidden in this key:HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\AdvancedHowever, there's another valuename in that key called SuperHidden. I tried modifying it but it didn't seem to do anything since I don't know where those super-super-hidden files are... maybe you can try that, cos I didn't find anything else...BTW it would be a good idea to make sure that the values are the same for both before you toggle.t's no good having The value of Hidden = 0 and then the value of SuperHidden = 1I thought of that, which is why I gave the function optional parameters. If I added that to the function and your explorer has hidden=0 and SuperHidden=1 then the function wouldn't do anything... So just make sure you are using the right parameters Link to comment Share on other sites More sharing options...
GEOSoft Posted October 3, 2007 Share Posted October 3, 2007 Maybe this? If $ToggleSuperHidden=1 Then If $ShowSuperHidden=1 Then RegWrite($RegKey,"ShowSuperHidden","REG_DWORD",0);=0 hide, 1 show Else If $Hidden =2 Then RegWrite($RegKey,"Hidden","REG_DWORD",1) $Hidden = 1 EndIf RegWrite($RegKey,"ShowSuperHidden","REG_DWORD",1);=0 hide, 1 show EndIf EndIf George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Nahuel Posted October 3, 2007 Share Posted October 3, 2007 Yeah, that seems to work great Didn't think about it. Link to comment Share on other sites More sharing options...
priZma Posted May 16, 2008 Share Posted May 16, 2008 (edited) @Nahuel Nice Script , but the only way this script works for me you must add a few lines. ;in the Update explorers area: Local $ah_WinExpListArr2 = WinList("classname=ExploreWClass") If $ah_WinExpListArr2[0][0] > 0 Then For $i = 1 To $ah_WinExpListArr2[0][0] Step 1 DllCall("user32.dll", "long", "SendMessage", "hwnd", $ah_WinExpListArr2[$i][1], "int", 0x111, "int", 28931, "int", 0) Next EndIf Patric Edited May 16, 2008 by priZma Link to comment Share on other sites More sharing options...
metalicaman8 Posted May 16, 2008 Share Posted May 16, 2008 FileSetAttrib ( "file pattern", "+-RASHNOT" [, recurse] ) Parameters file pattern File(s) to change, e.g. C:\*.au3, C:\Dir +-RASHNOT Attribute(s) to set/clear. e.g. "+A", "+RA-SH" recurse [optional] If this is set to 1, then directories are recursed into. Default is 0 (no recursion). Return Value Success: Returns 1. Failure: Returns 0 if encountered any errors. Remarks The file pattern cannot contain spaces! The attributes that can be modified with the function are + or -: "R" = READONLY "A" = ARCHIVE "S" = SYSTEM "H" = HIDDEN "N" = NORMAL "O" = OFFLINE "T" = TEMPORARY (Note that you cannot set the compressed/directory attributes with this function.) [center]Take the Magic: The Gathering 'What Color Are You?' Quiz.[/center] Link to comment Share on other sites More sharing options...
ShadowPuterDude Posted May 18, 2008 Share Posted May 18, 2008 The registry sub keys for HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced are: Hidden SuperHidden ShowSuperHidden HideFileExt The default values are 2,0,0,1 respectively. To show everything the values would need to be set to 1,1,1,0 respectively. A more complete function would be:expandcollapse popupFunc ToggleHiddenFiles($ToggleHidden=1,$ToggleSuperHidden=1,$ToggleShowSuperHidden=1,$ToggleFileExt=0) $RegKey="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" $Hidden=RegRead($RegKey,"Hidden") $SuperHidden=RegRead($RegKey,"SuperHidden") $ShowSuperHidden=RegRead($RegKey,"ShowSuperHidden") $HideFileExt=RegRead($RegKey,"HideFileExt") If $ToggleHidden=1 Then If $Hidden=1 Then RegWrite($RegKey,"Hidden","REG_DWORD",2);=2 hide,=1 show Else RegWrite($RegKey,"Hidden","REG_DWORD",1);=2 hide,=1 show EndIf EndIf If $ToggleSuperHidden=1 Then If $SuperHidden=1 Then RegWrite($RegKey,"SuperHidden","REG_DWORD",0);=0 hide, 1 show Else RegWrite($RegKey,"SuperHidden","REG_DWORD",1);=0 hide, 1 show EndIf EndIf If $ToggleShowSuperHidden=1 Then If $ShowSuperHidden=1 Then RegWrite($RegKey,"ShowSuperHidden","REG_DWORD",0);=0 hide, 1 show Else RegWrite($RegKey,"ShowSuperHidden","REG_DWORD",1);=0 hide, 1 show EndIf EndIf If $ToggleFileExt=1 Then If $HideFileExt=1 Then RegWrite($RegKey,"HideFileExt","REG_DWORD",0);=0 show, 1 hide Else RegWrite($RegKey,"HideFileExt","REG_DWORD",1);=0 show, 1 hide EndIf EndIf ;Get explorer windows: Opt("WinTitleMatchMode", 4) $WinList = WinList("classname=CabinetWClass") If IsArray($WinList) Then Local $WinListArr[$WinList[0][0]+1] For $iW = 1 To $WinList[0][0] $WinListArr[$iW] = $WinList[$iW][0] Next $WinListArr[0] = $WinList[0][0] ;~ Return $WinListArr Else ;~ Return "" EndIf ;Update explorers: $WinExpListArr =$WinListArr If IsArray($WinExpListArr) Then For $iWin = 1 To $WinExpListArr[0] $GetWinState = WinGetState($WinExpListArr[$iWin]) $Hwnd = WinGetHandle($WinExpListArr[$iWin]) DllCall("user32.dll", "long", "SendMessage", "hwnd", $hWnd, "int", 0x111, "int", 28931, "int", 0) Next EndIf $Hwnd = WinGetHandle("classname=Progman") DllCall("user32.dll", "long", "SendMessage", "hwnd", $hWnd, "int", 0x111, "int", 28931, "int", 0) EndFunc Usage: Toggle Show All:ToggleHiddenFiles(1,1,1,0) Toggle Hide All:ToggleHiddenFiles(2,0,0,1) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now