Get the App
SLTechnology News&Howtos  ›  Development  › 

How to implement bat with right-click display extension

Shulou Source: shulou.com Published: 2022-06-03 08:28:43 10月04日 Update

This article mainly introduces how to right-click to display the extension of the bat, the article is very detailed, has a certain reference value, interested friends must read it!

Show / hide system Files need to right-click any folder or file to display the menu

Show / hide extension needs to right-click the space in any folder to display the menu

Right-click to show (hide) the extension and system files. Bat

The code is as follows:

@ echo off

Reg delete "HKCR\ CLSID\ {00000000-0000-0000-0000-0000000012}" / f > nul 2 > nul

Reg delete "HKLM\ SOFTWARE\ Classes\ *\ shell\ DisplayFileExt" / f > nul 2 > nul

Reg delete "HKLM\ SOFTWARE\ Classes\ Folder\ shell\ DisplayFileExt" / f > nul 2 > nul

Del / f / Q "% windir%\ SuperHidden.vbs"% windir%\ SuperHidden1.vbs" > nul 2 > nul

> "% windir%\ SuperHidden.vbs" echo Dim WSHShell

> "% windir%\ SuperHidden.vbs" echo Set WSHShell = WScript.CreateObject ("WScript.Shell")

> "% windir%\ SuperHidden.vbs" echo if WSHShell.RegRead ("HKCU\ Software\ Microsoft\ Windows\ CurrentVersion\ Explorer\ Advanced\ HideFileExt") = 0 then

> "% windir%\ SuperHidden.vbs" echo WSHShell.RegWrite "HKCU\ Software\ Microsoft\ Windows\ CurrentVersion\ Explorer\ Advanced\ HideFileExt", "1", "REG_DWORD"

> "% windir%\ SuperHidden.vbs" echo WSHShell.RegWrite "HKCR\ CLSID\ {00000000-0000-0000-0000-0000000012}\ Instance\ InitPropertyBag\ command", "Show extension", "REG_SZ"

> "% windir%\ SuperHidden.vbs" echo WSHShell.SendKeys "{F5} + {F10} e"

> > "% windir%\ SuperHidden.vbs" echo else

> "% windir%\ SuperHidden.vbs" echo WSHShell.RegWrite "HKCU\ Software\ Microsoft\ Windows\ CurrentVersion\ Explorer\ Advanced\ HideFileExt", "0", "REG_DWORD"

> "% windir%\ SuperHidden.vbs" echo WSHShell.RegWrite "HKCR\ CLSID\ {00000000-0000-0000-0000-0000000012}\ Instance\ InitPropertyBag\ command", "hide extension", "REG_SZ"

> "% windir%\ SuperHidden.vbs" echo WSHShell.SendKeys "{F5} + {F10} e"

> > "% windir%\ SuperHidden.vbs" echo end if

> > "% windir%\ SuperHidden.vbs" echo Set WSHShell = Nothing

> > "% windir%\ SuperHidden.vbs" echo WScript.Quit (0)

> "% windir%\ SuperHidden1.vbs" echo Dim WSHShell

> "% windir%\ SuperHidden1.vbs" echo Set WSHShell = WScript.CreateObject ("WScript.Shell")

> > "% windir%\ SuperHidden1.vbs" echo sTitle1 = "SSH=0"

> > "% windir%\ SuperHidden1.vbs" echo sTitle2 = "SSH=1"

> "% windir%\ SuperHidden1.vbs" echo if WSHShell.RegRead ("HKCU\ Software\ Microsoft\ Windows\ CurrentVersion\ Explorer\ Advanced\ ShowSuperHidden") = 1 then

> "% windir%\ SuperHidden1.vbs" echo WSHShell.RegWrite "HKCU\ Software\ Microsoft\ Windows\ CurrentVersion\ Explorer\ Advanced\ ShowSuperHidden", "0", "REG_DWORD"

> "% windir%\ SuperHidden1.vbs" echo WSHShell.RegWrite "HKCU\ Software\ Microsoft\ Windows\ CurrentVersion\ Explorer\ Advanced\ Hidden", "2", "REG_DWORD"

> "% windir%\ SuperHidden1.vbs" echo WSHShell.RegWrite "HKCR\ CLSID\ {00000000-0000-0000-0000-0000000012}\ Instance\ InitPropertyBag\ command", "Show extension", "REG_SZ"

> "% windir%\ SuperHidden1.vbs" echo WSHShell.SendKeys "{F5} + {F10} e"

> "% windir%\ SuperHidden1.vbs" echo 'WSHShell.Popup "Poof, they're gone!", 1, sTitle1, vbInformation

> > "% windir%\ SuperHidden1.vbs" echo else

> "% windir%\ SuperHidden1.vbs" echo WSHShell.RegWrite "HKCU\ Software\ Microsoft\ Windows\ CurrentVersion\ Explorer\ Advanced\ ShowSuperHidden", "1", "REG_DWORD"

> "% windir%\ SuperHidden1.vbs" echo WSHShell.RegWrite "HKCU\ Software\ Microsoft\ Windows\ CurrentVersion\ Explorer\ Advanced\ Hidden", "1", "REG_DWORD"

> "% windir%\ SuperHidden1.vbs" echo WSHShell.RegWrite "HKCR\ CLSID\ {00000000-0000-0000-0000-0000000012}\ Instance\ InitPropertyBag\ command", "Show extension", "REG_SZ"

> "% windir%\ SuperHidden1.vbs" echo WSHShell.SendKeys "{F5} + {F10} e"

> "% windir%\ SuperHidden1.vbs" echo 'WSHShell.Popup "Here they are!", 1, sTitle2, vbInformation

> > "% windir%\ SuperHidden1.vbs" echo end if

> > "% windir%\ SuperHidden1.vbs" echo Set WSHShell = Nothing

> > "% windir%\ SuperHidden1.vbs" echo WScript.Quit (0)

Reg export "HKCU\ Software\ Microsoft\ Windows\ CurrentVersion\ Explorer\ Advanced"% temp%\ _ _ .reg" > nul

For / f "tokens=2 delims=="%. In ('find/i "HideFileExt"% temp%\ _ _ .reg"') do set vests% percent.

Del "% temp%\ _ _ .reg"

Set vault% VRV voucher 1%

If v equ 0 set vv= hide extension

If v equ 1 set vv= display extension

> "% temp%\ _ .reg" echo REGEDIT4

> > "% temp%\ _ .reg" echo [HKEY_CLASSES_ROOT\ Directory\ Background\ shellex\ ContextMenuHandlers\ SuperHidden]

> > "% temp%\ _ .reg" echo @ = "{00000000-0000-0000-0000-0000000012}"

> > "% temp%\ _ .reg" echo [HKEY_CLASSES_ROOT\ CLSID\ {00000000-0000-0000-0000-0000000012}\ InProcServer32]

> "% temp%\ _ .reg" echo @ = hex (2): 25pence 53reg 79pens 73pence 74pence 6dpence 52pence 6fpence 6fpence 54pens 5c pence 73pence 74g 73pr 74g 65pr 64g 65pr 6d 3pr 32pence 5cpr 73,\

> > "% temp%\ _ .reg" echo 68pr 64f recorder 64f recorder 63m 77parcel 77e recorder 64m 6cjingle 6cjing00

> "% temp%\ _ .reg" echo "ThreadingModel" = "Apartment"

> > "% temp%\ _ .reg" echo [HKEY_CLASSES_ROOT\ CLSID\ {00000000-0000-0000-0000-0000000012}\ Instance]

> "% temp%\ _ .reg" echo "CLSID" = "{3f454f0e-42ae-4d7c-8ea3-328250d6e272}"

> > "% temp%\ _ .reg" echo [HKEY_CLASSES_ROOT\ CLSID\ {00000000-0000-0000-0000-0000000012}\ Instance\ InitPropertyBag]

> "% temp%\ _ .reg" echo "method" = "ShellExecute"

> "% temp%\ _ .reg" echo "Param1" = "SuperHidden.vbs"

> "% temp%\ _ .reg" echo "CLSID" = "{13709620-C279-11CE-A49E-444553540000}"

> "% temp%\ _ .reg" echo "command" = "% vv%"

> > "% temp%\ _ .reg" echo [HKEY_LOCAL_MACHINE\ SOFTWARE\ Classes\ *\ shell\ DisplayFileExt]

> "% temp%\ _ .reg" echo @ = "Show / hide system files"

> > "% temp%\ _ .reg" echo [HKEY_LOCAL_MACHINE\ SOFTWARE\ Classes\ *\ shell\ DisplayFileExt\ Command]

> "% temp%\ _ .reg" echo @ = "WScript.exe C:\\ Windows\\ SuperHidden1.vbs"

> > "% temp%\ _ .reg" echo [HKEY_LOCAL_MACHINE\ SOFTWARE\ Classes\ Folder\ shell\ DisplayFileExt]

> "% temp%\ _ .reg" echo @ = "Show / hide system files"

> > "% temp%\ _ .reg" echo [HKEY_LOCAL_MACHINE\ SOFTWARE\ Classes\ Folder\ shell\ DisplayFileExt\ Command]

> "% temp%\ _ .reg" echo @ = "WScript.exe C:\\ Windows\\ SuperHidden1.vbs"

Regedit / s "% temp%\ _ .reg"

Del / f / Q "% temp%\ _ .reg"

Exit

Right click to restore the original. Bat

The code is as follows:

@ echo off

Reg delete "HKCR\ CLSID\ {00000000-0000-0000-0000-0000000012}" / f > nul 2 > nul

Reg delete "HKLM\ SOFTWARE\ Classes\ *\ shell\ DisplayFileExt" / f > nul 2 > nul

Reg delete "HKLM\ SOFTWARE\ Classes\ Folder\ shell\ DisplayFileExt" / f > nul 2 > nul

Del / f / Q "% windir%\ SuperHidden.vbs"% windir%\ SuperHidden1.vbs" > nul 2 > nul

The above is all the contents of the article "how to right-click to display the extension bat". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Extensions files systems code content folders articles menus values interests as is guys buddies more knowledge blanks industry information information channels channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology MariaDB MySQL Huawei Linux