右键显示(隐藏)扩展名的bat代码_DOS/BAT

“显示/隐藏 系统文件”需右键单击任意文件夹或文件才能显示菜单
“显示/隐藏 扩展名”需右键单击任意文件夹里的空白处才能显示菜单

右键显示(隐藏)扩展名及系统文件.bat

复制代码 代码如下:

@echo off
reg delete "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}" /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-000000000012}\Instance\InitPropertyBag\command", "显示扩展名", "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-000000000012}\Instance\InitPropertyBag\command", "隐藏扩展名", "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-000000000012}\Instance\InitPropertyBag\command", "显示扩展名", "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-000000000012}\Instance\InitPropertyBag\command", "显示扩展名", "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 v=%%~.
del "%temp%\__.reg"
set v=%v:~-1%
if %v% equ 0 set vv=隐藏扩展名
if %v% equ 1 set vv=显示扩展名
>"%temp%\_.reg" echo REGEDIT4
>>"%temp%\_.reg" echo [HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\SuperHidden]
>>"%temp%\_.reg" echo @="{00000000-0000-0000-0000-000000000012}"
>>"%temp%\_.reg" echo [HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-000000000012}\InProcServer32]
>>"%temp%\_.reg" echo @=hex(2):25,53,79,73,74,65,6d,52,6f,6f,74,25,5c,73,79,73,74,65,6d,33,32,5c,73,\
>>"%temp%\_.reg" echo 68,64,6f,63,76,77,2e,64,6c,6c,00
>>"%temp%\_.reg" echo "ThreadingModel"="Apartment"
>>"%temp%\_.reg" echo [HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-000000000012}\Instance]
>>"%temp%\_.reg" echo "CLSID"="{3f454f0e-42ae-4d7c-8ea3-328250d6e272}"
>>"%temp%\_.reg" echo [HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-000000000012}\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 @="显示/隐藏 系统文件"
>>"%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 @="显示/隐藏 系统文件"
>>"%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

右键恢复原样.bat

复制代码 代码如下:

@echo off
reg delete "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}" /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

时间: 2024-12-30 15:40:11

右键显示(隐藏)扩展名的bat代码_DOS/BAT的相关文章

将目录下的文件按扩展名分类的bat代码_DOS/BAT

其实就是利用强大的for命令实现 实现代码: 复制代码 代码如下: for %%i in (*) do (md %%~ximove *%%~xi %%~xi)pause %~xI          - 仅将 %I 扩展到一个文件扩展名只打印文件的扩展名FOR /F "delims==" %%i IN ('dir /b') DO @echo    %%~xipause

用批处理一键安装两种扩展名的Windows系统补丁_DOS/BAT

每个人都可能重装过操作系统.可每次安装好操作系统后花费时间最长的就是下载补丁安装补丁了,往往下载补丁安装补丁都花去了大半天的事情,在Vista以后,微软发布的补丁大都是msu的,当然也有少部份还是以前的exe.下面介绍一种针对这两种扩展名的系统补丁快速安装的办法. 借助软件下载最新的系统补丁并保存在spacks文件夹,在该文件夹内新建一文本文件,输入以下代码 @Echo Off Title Install Windows Update pack Echo 正在安装Windows系统补丁,请稍等.

建立隐藏磁盘的bat代码_DOS/BAT

复制代码 代码如下: @ECHO OFF  MD E:\RECYCLER\UDrives.{645FF040-5081-101B-9F08-00AA002F954E}>NUL  IF EXIST X:\NUL GOTO DELETE  SUBST X: E:\RECYCLER\UDrives.{645FF040-5081-101B-9F08-00AA002F954E}  START  X:\  GOTO END  :DELETE SUBST /D X:  :END 把上面的内容用记事本另存为 .

显示系统信息与硬件信息的bat代码_DOS/BAT

显示系统信息的dos命令,使用批处理显示硬件信息的批处理 这个得看你需要查看的方式. 1. cmd窗口查看 2. 程序窗口查看 3. 文本查看 方法1. cmd窗口查看: @echo off systeminfo dxdiag /dontskip /whql:off /t systeminfo1.txt&&more systeminfo1.txt pause 方法2. 程序窗口查看: @echo off msinfo32 dxdiag pause 方法3. 文本查看: @echo off

Dos批处理编写一键清理系统垃圾的bat代码_DOS/BAT

del 命令的参数 /F 强制删除只读文件. /S 从所有子目录删除指定文件. /Q 安静模式.删除全局通配符时,不要求确认. rd 命令的参数 /s 除目录本身外,还将删除指定目录下的所有子目录和文件.用于删除目录树. /q 安静模式 /s 删除目录树时不要求确认. 代码一 @echo off & title 清理系统垃圾 del /f /s /q %systemdrive%\*.tmp del /f /s /q %systemdrive%\*.mp3 del /f /s /q %system

dos批量替换当前目录后缀名的实现代码_DOS/BAT

有时候有些后缀名不满足条件,就需要进行批量的替换,如果人为的去替换,那么如果量少的话还好说,量多的话一个个去替换就太傻了,今天从网络上面查找了一些批量替换的dos命令,用起来还挺好用的,就直接把代码贴在这边. 比如有时候照相出来的后缀名都是jpeg,但是有些网站为了安全,直接限制只能上传jpg的后缀名,这个时候就可以用这个批量替换工具了. 复制代码 代码如下: @echo off set /p filename=请输入要替换的后缀名: echo. set /p filename2=请输入替换后的

迁移图片目录的bat代码_DOS/BAT

复制代码 代码如下: @echo off setlocal enabledelayedexpansion ::开启变量延迟,加入自定义变量名 set sourpic=e:\pic ::定义图片源 set despic=e:\img ::定义图片存储地址 set pictype=*.jpg ::定义图片类型 set log=e:\log.txt ::定义Log信息,这个每次都会重新生成 rem 处理开始的日志记录 echo 图片取自:%sourpic% >%log% echo 上传目录:%desp

清理IE和使用历史记录的bat代码_DOS/BAT

复制代码 代码如下: @echo off title: IE temporary file deleter echo 正在 清除Internet临时文件 ............ RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8 echo 清除Cookies RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2 echo 清除历史记录 RunDll32.exe InetCpl.cpl,ClearMyT

批处理获取IP生成TXT文本的bat代码_DOS/BAT

第一种方法: 复制代码 代码如下: @echo off <"%~f0" more +5 >tmp.vbs cscript //NoLogo /e:vbscript tmp.vbs %1>ip.txt echo >nul && del tmp.vbs goto:eof set oDOM = WScript.GetObject("http://www.duosc.com/ip.aspx") do until oDOM.readyS