topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 12:24 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: Show/ Do not Show Hidden files and folders  (Read 12696 times)

ronriel

  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 15
    • View Profile
    • Donate to Member
IDEA: Show/ Do not Show Hidden files and folders
« on: May 11, 2007, 08:11 AM »
I have my little sister using my computer so i make some of my files/folders hidden. But when i need to access those files/folders then i will have to go to "folder options" to show those hidden files. Of course i will have to set the computer again not to show those hidden files after I'm finished using them. It's a tedious and repetitive task. What i want is a little utility to make Hiding/showing those hidden files easy like a click on an icon or a press on a hotkey. Thanks..
-ronriel

Cpilot

  • Charter Honorary Member
  • Joined in 2006
  • ***
  • Posts: 293
    • View Profile
    • Bite Notes
    • Read more about this member.
    • Donate to Member
Re: IDEA: Show/ Do not Show Hidden files and folders
« Reply #1 on: May 11, 2007, 09:00 AM »
Here's a quick script written in FBSL. It's only been tested on WinXP.
Simply click the icon to toggle between visible and not visible.
If you have an explorer window open you'll need to refresh it to see the changes.

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: IDEA: Show/ Do not Show Hidden files and folders
« Reply #2 on: May 11, 2007, 01:03 PM »
another way is to get a good file manager as that will allow you view hidden files/folders, then you can let your sister use the computer as it is - with your files/folders hidden.. :)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: Show/ Do not Show Hidden files and folders
« Reply #3 on: May 11, 2007, 02:56 PM »
cpilot, nice, that could come in handy to add to a toolbar  :up:

Cpilot

  • Charter Honorary Member
  • Joined in 2006
  • ***
  • Posts: 293
    • View Profile
    • Bite Notes
    • Read more about this member.
    • Donate to Member
Re: IDEA: Show/ Do not Show Hidden files and folders
« Reply #4 on: May 11, 2007, 03:19 PM »
cpilot, nice, that could come in handy to add to a toolbar  :up:
Thanks.
Yeah it could, I threw it up there quick though to give him what he wanted.  :Thmbsup:

ronriel

  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 15
    • View Profile
    • Donate to Member
Re: IDEA: Show/ Do not Show Hidden files and folders
« Reply #5 on: May 13, 2007, 06:50 AM »
Thank you Cpilot. That is EXACTLY what i want :D ... and that was quite a quick response! I'm sorry for my late reply though. Thanks again man.   :Thmbsup:
-ronriel

Cpilot

  • Charter Honorary Member
  • Joined in 2006
  • ***
  • Posts: 293
    • View Profile
    • Bite Notes
    • Read more about this member.
    • Donate to Member
Re: IDEA: Show/ Do not Show Hidden files and folders
« Reply #6 on: May 13, 2007, 03:23 PM »
Thank you Cpilot. That is EXACTLY what i want :D ... and that was quite a quick response! I'm sorry for my late reply though. Thanks again man.   :Thmbsup:
No problem, just glad I could help.

aCkRiTe

  • Honorary Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 21
    • View Profile
    • Donate to Member
Re: IDEA: Show/ Do not Show Hidden files and folders
« Reply #7 on: May 17, 2007, 10:04 AM »
Here is a way to do it with AHK. It uses the hotkey (WinKey + H). It also refreshes the window as well...

#SingleInstance Force
#Persistent
#NoEnv
SetBatchLines, -1

#h::

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, 28931,,, ahk_id %ID%
Return


You can downlaod here http://www.autohotke.../Toggle%20Hidden.rar


HTH...
« Last Edit: May 19, 2007, 05:29 PM by aCkRiTe »

ronriel

  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 15
    • View Profile
    • Donate to Member
Re: IDEA: Show/ Do not Show Hidden files and folders
« Reply #8 on: May 19, 2007, 05:17 AM »
thanks aCkRiTe... refreshing the window is an extra mouse click. so thank you..  :Thmbsup:
-ronriel

ronriel

  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 15
    • View Profile
    • Donate to Member
Re: IDEA: Show/ Do not Show Hidden files and folders
« Reply #9 on: May 19, 2007, 07:03 AM »
aCkRiTe, have you used Autoit3? which do you think is more powerful?  I have Autoit3 installed and so far am very happy with it. As soon as i knew which registry values to manipulate, I was able to implement this function on hotkeys... however, i was not able to get it to refresh the windows automatically. Well, i'm not very good at Autoit3 either b'coz i have only discovered it last week.

They say, both Autoit3 and Ahk have a common beginning, so which is better?
Am i better off switching to AHK (i have used Autoit3 for a week anyway) or stick to autoit3?

I'm sorry if this is a little off topic...
-ronriel

aCkRiTe

  • Honorary Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 21
    • View Profile
    • Donate to Member
Re: IDEA: Show/ Do not Show Hidden files and folders
« Reply #10 on: May 19, 2007, 12:28 PM »
Well I glad you like it and your welcome. I have never used Autoit3 so I dont know too much about it, though I hear they are similar. I dont know if Autoit3 is more or less powerful than AHK, but AHK can do A LOT in my opinion and the people over at the forum are finding that out more each day. I would highly recommand AutoHotKey! I picked it up about 10 months ago and it was so easy to learn. Only background I had in scripting was Windows Shell Scripting, but was able to pick AHK up quickly. They have great documentation and a great forum. Hope this information was some what helpful and some of it is just my opinion. BTW I just came across this forum the other day. I hope to be a little active over here, seems like a great forum!

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: IDEA: Show/ Do not Show Hidden files and folders
« Reply #11 on: May 19, 2007, 12:41 PM »
for the record, i'm impartial but here are some threads from the forum that may help you to make up your mind.. :)

AutoIt3 versus AutoHotKey
Living without AutoHotkey - possible?


AndyM

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 616
    • View Profile
    • Donate to Member
Re: IDEA: Show/ Do not Show Hidden files and folders
« Reply #12 on: May 19, 2007, 04:38 PM »
Here is a way to do it with AHK. It uses the hotkey (WinKey + H). It also refreshes the window as well...

#SingleInstance Force
#Persistent
#NoEnv
SetBatchLines, -1

Menu,Tray,Tip,ToggleHidden  ; ANDY ADDED THIS LINE
                                       
#h::

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, 28931,,, ahk_id %ID%
Return[/size][/size][/size]


You can downlaod here http://www.autohotke...%20Files-Folders.zip


HTH...

This is really handy, and toggles hidden/unhidden and refreshes the folder instantly.
The link is a stand-alone .exe file, but I just pasted the above code into ToggleHidden.ahk, and stuck a shortcut in my start-up folder.

aCkRiTe, you should name this and put it over in "Finished Programs" so more people would notice it!  (and send Donation Credits)

ronriel

  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 15
    • View Profile
    • Donate to Member
Re: IDEA: Show/ Do not Show Hidden files and folders
« Reply #13 on: June 25, 2007, 09:43 PM »
I want the script to refresh/update the desktop and all existing windows as well so i don't have to manually refresh all the other windows and the desktop.
So here's a script in Autoit3. It Refreshes all open windows including the desktop all at once like when you make changes under the view tab of the folder options. It shows system files as well. Just press winkey+h.

Code:
Opt ("WinTitleMatchMode", 4)
HotKeySet ("#h", "SH")

Func SH()
        $key = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
        $read = RegRead ($key, "Hidden")
        If $read = 1 Then
                RegWrite ($key, "Hidden", "REG_DWORD", "2")
                RegWrite ($key, "ShowSuperHidden", "REG_DWORD", "0")
                UpdateExplorer()
        Else
                RegWrite ($key, "Hidden", "REG_DWORD", "1")
                RegWrite ($key, "ShowSuperHidden", "REG_DWORD", "1")
                UpdateExplorer()
        EndIf
EndFunc

Func UpdateExplorer()
        $Win = WinList ("classname=CabinetWClass")
        If IsArray ($Win) Then
                For $i = 1 To $Win[0][0]
                        DllCall ("user32.dll", "long", "SendMessage", "hwnd", $Win[$i][1], "int", 0x111, "int", 28931, "int", 0)
                Next
        EndIf
        DllCall ("user32.dll", "long", "SendMessage", "hwnd", WinGetHandle ("classname=Progman"), "int", 0x111, "int", 28931, "int", 0)
EndFunc

While 1
        Sleep (10000)
WEnd

and the compiled script..
-ronriel
« Last Edit: August 23, 2007, 02:00 AM by ronriel »