| View previous topic :: View next topic |
| Author |
Message |
jps
Joined: 02 Sep 2006 Posts: 253 Location: Scotland
|
Posted: Sat Oct 21, 2006 2:02 am Post subject: Show/Hide Hidden files and folders |
|
|
Can anyone tell me a way to make a hotkey toggle whether hidden files and folders are shown or not?
I've searched but havent been able to find anything. |
|
| Back to top |
|
 |
AiKscroll
Joined: 06 Jun 2005 Posts: 179 Location: Northern Virginia
|
Posted: Sat Oct 21, 2006 4:24 am Post subject: |
|
|
First you have to resolve how you want this done. Is it acceptable to have the script launch Control panel, then Folder options, then check the correct box, etc? Or is it not, say you want to do this in the middle of a game.
If you want it done without the messing with the many steps, you need to figure out what windows is doing when you show/hide folders whether it be messing with the registry, writing to an ini, or whatever. Knowing that will help you determine how to go about solving this problem.
If anyone knows what the Folder Options dialog does when you check/uncheck Show hidden files please mention it, cause I don't know. _________________ _AiK |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6223
|
Posted: Sat Oct 21, 2006 5:05 am Post subject: Re: Show/Hide Hidden files and folders |
|
|
| jps wrote: | | Can anyone tell me a way to make a hotkey toggle whether hidden files and folders are shown or not? |
| AiKscroll wrote: | | If anyone knows what the Folder Options dialog does when you check/uncheck Show hidden files please mention it, cause I don't know. |
The following code toggles the hidden files view, in Windows Explorer:
| Code: | ^F2::GoSub,CheckActiveWindow
CheckActiveWindow:
ID := WinExist("A")
WinGetClass,Class, ahk_id %ID%
WClasses := "CabinetWClass ExploreWClass"
IfInString, WClasses, %Class%
GoSub, Toggle_HiddenFiles_Display
Return
Toggle_HiddenFiles_Display:
RootKey = HKEY_CURRENT_USER
SubKey = Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
RegRead, HiddenFiles_Status, % RootKey, % SubKey, Hidden
if HiddenFiles_Status = 2
RegWrite, REG_DWORD, % RootKey, % SubKey, Hidden, 1
else
RegWrite, REG_DWORD, % RootKey, % SubKey, Hidden, 2
PostMessage, 0x111, 41504,,, ahk_id %ID%
Return |
See: How to Toggle Hidden files view in Windows Explorer?
Regards,  _________________
 |
|
| Back to top |
|
 |
aCkRiTe
Joined: 21 Jul 2006 Posts: 517
|
Posted: Sat Oct 21, 2006 5:17 am Post subject: |
|
|
I see Goyyah beat me to it. This is what I came up with though
| Code: |
#SingleInstance Force
#Persistent
#NoEnv
SetBatchLines, -1
Value = 1
#H::
If Value = 1
Value = 2
Else
Value = 1
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\, Hidden, %Value%
|
More info here...
http://www.winguides.com/registry/display.php/1007/ |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6223
|
Posted: Sat Oct 21, 2006 5:22 am Post subject: |
|
|
| aCkRiTe wrote: | | This is what I came up with though |
Nice .. I had borrowed the code except for PostMessage, 0x111, 41504,,, which simulates the F5 (refresh).
Regards,  _________________
 |
|
| Back to top |
|
 |
aCkRiTe
Joined: 21 Jul 2006 Posts: 517
|
Posted: Sat Oct 21, 2006 5:25 am Post subject: |
|
|
| Ahh... I forgot the Refresh{F5} part... Thanks Goyyah! I always learn something in here! |
|
| Back to top |
|
 |
Hansol
Joined: 27 Dec 2005 Posts: 18
|
Posted: Sat Oct 21, 2006 1:51 pm Post subject: |
|
|
| Quote: | However, as said before, the problem seems to be in refreshing the registry but, if after running the script i run regedit and update using F5 manually, then turn to explorer and press F5 the changes are not shown.
On the other and, if, after running the script, i manually go to tools -> folder options.. -> second tab (see or view), i can see that the option has changed and if i close the window (not even need to press accept) then the trick is done. | http://www.autohotkey.com/forum/viewtopic.php?t=1204
Is there any way to solve that problem? The changes is done but take no effect? |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6223
|
Posted: Sat Oct 21, 2006 8:52 pm Post subject: |
|
|
| Hansol wrote: | | Is there any way to solve that problem? The changes is done but take no effect? |
I see the point.. I had tested that code only in Windows 98 SE.. It does not seem to work in Windows 2000 for me now!
I will try and find a way & post again.. Thanks!  _________________
 |
|
| Back to top |
|
 |
aCkRiTe
Joined: 21 Jul 2006 Posts: 517
|
Posted: Sat Oct 21, 2006 10:15 pm Post subject: |
|
|
I havent tested, but would this work...
| Code: | | Run, %A_WinDir%\System32\RUNDLL32.EXE user32.dll`,UpdatePerUserSystemParameters |
|
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6223
|
Posted: Sat Oct 21, 2006 10:17 pm Post subject: |
|
|
| aCkRiTe wrote: | | but would this work... |
It does not .. _________________
 |
|
| Back to top |
|
 |
jps
Joined: 02 Sep 2006 Posts: 253 Location: Scotland
|
Posted: Sat Oct 21, 2006 10:30 pm Post subject: |
|
|
Thanks for the replies guys
I find pressing F5 works only some of the time but pressing the Appskey and then e works every time.
I can live with the right-click menu showing for a brief second so I tried incorporating that into the script but with no avail.
Could you edit one of the scripts to refresh that way for me?
Sorry for just straight up asking you guys to do stuff for me but i'm really struggling to get the hang of scripting.I'm sure i'll get there in the end but it will take a while.The only programing experience i have was using basic at school 10 years ago lol |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6223
|
Posted: Sat Oct 21, 2006 10:41 pm Post subject: |
|
|
| jps wrote: | | Could you edit one of the scripts to refresh that way for me? |
Replace the PostMessage line with
Regards,
PS: Keep a watch on this topic.. I will post again if I come out with something more elegant! _________________
 |
|
| Back to top |
|
 |
Conquer
Joined: 27 Jun 2006 Posts: 385 Location: Canada
|
Posted: Sat Oct 21, 2006 10:41 pm Post subject: |
|
|
AppsKey & E Code:
EDIT:
That was a fast reply, goyah!! Beat mine...  _________________

Last edited by Conquer on Sat Oct 21, 2006 10:51 pm; edited 1 time in total |
|
| Back to top |
|
 |
jps
Joined: 02 Sep 2006 Posts: 253 Location: Scotland
|
Posted: Sat Oct 21, 2006 10:44 pm Post subject: |
|
|
Thanks for such a quick reply. It works a charm.
I always get mixed up with where to put my curly braces |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6223
|
Posted: Sat Oct 21, 2006 11:33 pm Post subject: |
|
|
| Conquer wrote: | That was a fast reply, goyah!! Beat mine...  |
That happens many times for me too  _________________
 |
|
| Back to top |
|
 |
|