Jump to content

file ext toggle [solved]


b-man

Recommended Posts

i found this on another forum for toggling hidden files

can someone change it to toggle file extensions

and is it possible to add a checkmark when its enabled (showing file extensions)

This works OK on my 64-bit Home Premium System. It adds the option to your context or "right-click" menu.

It consists of a .vbs file and a .reg file. I can't remember where I found it though ('twas last Chrimble!)

so I'm copying the "codes" here.

Open a New Text Document.txt and copy this code into it.


Hidden = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden"
SHidden = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden"
Set Sh = WScript.CreateObject("WScript.Shell")
St = Sh.RegRead(Hidden)
If St = 2 Then
Sh.RegWrite Hidden, 1, "REG_DWORD"
Sh.RegWrite SHidden, 1, "REG_DWORD"
Else
Sh.RegWrite Hidden, 2, "REG_DWORD"
Sh.RegWrite SHidden, 0, "REG_DWORD"
End If
Sh.SendKeys("{F5}")

Save it using "Save As..." as Show_Hidden_Files_Switch.vbs (or just save the New Text Document.txt, when saved just re-name it, including extension). Place it in your C:\Windows Folder.

Then make a .reg file using the same method with this code.


Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\Show / Hide Hidden Files]
"HasLUAShield"=""

[HKEY_CLASSES_ROOT\Directory\Background\shell\Show / Hide Hidden Files\command]
@="cmd.exe /c start C:\\Windows\\Show_Hidden_Files_Switch.vbs"

Save it as Whatever_You_Want.reg. Then just (Run) Merge the .reg file into the registry and you're good to go. It will "instantly" be in your context menu. No re-boot required.

If you later change your mind and want it off your context menu, make a reg file with this code.

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\Directory\Background\shell\Show / Hide Hidden Files]

Run it and the context menu entry will be gone.

HTH.

Edited by b-man
Link to comment
Share on other sites


ok for ppl that want to know how to do it i have worked it out - works with my win 7 64bit but dont see why it wouldnt work with any version of xp/ vista or win 7

with my knowledge of scripting (none) and registry (amature) heres my script and reg files

has a checkmark when file extensions are showing and changes between (show file extensions) and (hide file extensions) in right click menu

script

open notepad place the script code and save as FileExtToggle.vbs

location- place in c:\Windows\Bman\FileExtToggle\

Hide = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt"

Set Sh = WScript.CreateObject("WScript.Shell")

St = Sh.RegRead(Hide)

sRegFile1 = "C:\Windows\Bman\FileExtToggle\Hide.reg"

sRegFile2 = "C:\Windows\Bman\FileExtToggle\Show.reg"

If St = 0 Then

Sh.RegWrite Hide, 1, "REG_DWORD"

sh.Run "regedit.exe /s " & Chr(34) & sRegFile1 & Chr(34), 0, True

Else

Sh.RegWrite Hide, 0, "REG_DWORD"

sh.Run "regedit.exe /s " & Chr(34) & sRegFile2 & Chr(34), 0, True

End If

Sh.SendKeys("{F5}")

Hide.reg (open notepad paste and save as Hide.reg)

location- place in c:\Windows\Bman\FileExtToggle\

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\Show File Extension]

[HKEY_CLASSES_ROOT\Directory\Background\shell\Show File Extension\command]
@="cmd.exe /c start C:\\Windows\\Bman\\FileExtToggle\\FileExtToggle.vbs"

[-HKEY_CLASSES_ROOT\Directory\Background\shell\Hide File Extension]
"Icon"="C:\\Windows\\Bman\\Icons\\Context Menu\\checkmark.ico"

[-HKEY_CLASSES_ROOT\Directory\Background\shell\Hide File Extension\command]
@="cmd.exe /c start C:\\Windows\\Bman\\FileExtToggle\\FileExtToggle.vbs"

Show.reg (open notepad paste and save as Show.reg)

location- place in c:\Windows\Bman\FileExtToggle\

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\Directory\Background\shell\Show File Extension]

[-HKEY_CLASSES_ROOT\Directory\Background\shell\Show File Extension\command]
@="cmd.exe /c start C:\\Windows\\Bman\\FileExtToggle\\FileExtToggle.vbs"

[HKEY_CLASSES_ROOT\Directory\Background\shell\Hide File Extension]
"Icon"="C:\\Windows\\Bman\\Icons\\Context Menu\\checkmark.ico"

[HKEY_CLASSES_ROOT\Directory\Background\shell\Hide File Extension\command]
@="cmd.exe /c start C:\\Windows\\Bman\\FileExtToggle\\FileExtToggle.vbs"

checkmark

google a checkmark icon u want, convert to ico file by http://www.coolutils.com/online/image-converter/

save in C:\Windows\Bman\Icons\Context Menu\checkmark.ico

and your done

execute vbs file once to give u the menu in right click

Edited by b-man
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...