China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-11 06:58
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Fool-style [Right-click Menu: Show/Hide Extensions and Files] View 1,582 Replies 10
Original Poster Posted 2008-07-29 09:11 ·  中国 广东 梅州 电信
中级用户
★★
Credits 262
Posts 129
Joined 2007-07-11 06:50
19-year member
UID 93679
Gender Male
Status Offline










No more talk, look at the pictures.

Show/hide items: extensions, hidden folders and files, system files

Install: directly double-click the batch file
Uninstall: double-click the batch file again


--------------->>>Click to download<<<---------------

Below is the source code: The code is very simple, and I'm not any kind of expert either. I copied that FOR command from someone else and just modified it a bit myself. I believe there are still many places that are pretty rough.

@echo off
mode con cols=41 lines=4
title Right-click Menu Show/Hide Extensions and Files
color 0b
if not exist "%windir%\SuperHidden.vbs" goto setup
reg delete "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}" /f >nul 2>nul
del /f /q "%windir%\SuperHidden.vbs" >nul 2>nul
echo.&echo Uninstall complete.
pause>nul
exit


:setup
color 0a
>"%windir%\SuperHidden.vbs" echo Dim WSHShell
>>"%windir%\SuperHidden.vbs" echo Set WSHShell = WScript.CreateObject("WScript.Shell")

>>"%windir%\SuperHidden.vbs" echo WSHShell.RegWrite "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag\CLSID", "{13709620-C279-11CE-A49E-444553540000}", "REG_SZ"

>>"%windir%\SuperHidden.vbs" echo WSHShell.RegWrite "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag\method", "ShellExecute", "REG_SZ"

>>"%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\ShowSuperHidden", "0", "REG_DWORD"
>>"%windir%\SuperHidden.vbs" echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden", "2", "REG_DWORD"
>>"%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", "Show", "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\ShowSuperHidden", "1", "REG_DWORD"
>>"%windir%\SuperHidden.vbs" echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden", "1", "REG_DWORD"
>>"%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", "Hide", "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)

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=Hide
if %v% equ 1 set vv=Show

>"%temp%\_.reg" echo REGEDIT4
>>"%temp%\_.reg" echo
>>"%temp%\_.reg" echo @="{00000000-0000-0000-0000-000000000012}"
>>"%temp%\_.reg" echo
>>"%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
>>"%temp%\_.reg" echo "CLSID"="{3f454f0e-42ae-4d7c-8ea3-328250d6e272}"
>>"%temp%\_.reg" echo
>>"%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%"
regedit /s "%temp%\_.reg"
del /f /q "%temp%\_.reg"
echo.&echo Right-click %vv% added.
pause>nul
exit


[ Last edited by kidzgy on 2008-7-29 at 09:16 AM ]
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
slore +8 2008-07-29 10:39
Floor 2 Posted 2008-07-29 09:45 ·  中国 广东 广州 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
<Fragrant Drifting> -- "you are very strong!"
Floor 3 Posted 2008-07-29 10:39 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
Thanks for providing the registry location.
S smile 微笑,L love 爱,O optimism 乐观,R relax 放松,E enthusiasm 热情...Slore
Floor 4 Posted 2008-07-29 12:10 ·  中国 广东 肇庆 电信
中级用户
★★
Credits 206
Posts 103
Joined 2008-05-06 16:59
18-year member
UID 117911
Gender Male
From 广东 肇庆
Status Offline
Works very well.
Floor 5 Posted 2008-07-29 12:30 ·  中国 广东 韶关 电信
高级用户
★★★
CMD感染者
Credits 691
Posts 383
Joined 2008-05-23 00:38
18-year member
UID 119451
Gender Male
Status Offline
Invalid in a Win Xp Sp2 environment
+++ Verification complete +++


Mistakes must be corrected
I don't know what was going on in the original test, the right-click menu didn't change
But when I tried again later, it showed up

[ Last edited by radem on 2008-7-29 at 03:10 PM ]
Floor 6 Posted 2008-07-29 14:37 ·  中国 广东 梅州 电信
中级用户
★★
Credits 262
Posts 129
Joined 2007-07-11 06:50
19-year member
UID 93679
Gender Male
Status Offline
I don't know what was going on with the poster above, mine is XP SP2 too.

Oh~ false alarm, hehe·~

[ Last edited by kidzgy on 2008-7-30 at 08:16 AM ]
Floor 7 Posted 2008-07-31 10:10 ·  中国 广东 梅州 电信
中级用户
★★
Credits 262
Posts 129
Joined 2007-07-11 06:50
19-year member
UID 93679
Gender Male
Status Offline
I wonder if any brother here could help me simplify my code a bit~

I feel that so many echo lines are such a hassle
Floor 8 Posted 2008-08-06 18:22 ·  中国 广东 广州 电信
初级用户
★★
Credits 109
Posts 65
Joined 2008-07-28 22:04
18-year member
UID 122281
Gender Female
Status Offline
Mine got blocked by Kingsoft...
Floor 9 Posted 2009-01-23 00:19 ·  中国 广东 东莞 电信
初级用户
Credits 50
Posts 44
Joined 2008-12-07 13:05
17-year member
UID 133134
Gender Male
Status Offline
Thanks L
Floor 10 Posted 2009-01-23 10:11 ·  中国 江苏 南京 电信
初级用户
★★
Credits 62
Posts 62
Joined 2007-07-14 14:39
19-year member
UID 93962
Gender Male
Status Offline
This function is really very practical, and the code is also very clear. The operation points and objects are all very explicit; it's truly a model example for beginners to learn from. I guess if you really want to simplify it, you'd have to use third-party tools—but I don't agree with doing that, it's still more convenient to work in the environment that comes with the system.
Floor 11 Posted 2009-01-23 10:37 ·  美国 华盛顿州 金 雷德蒙德 Microsoft
初级用户
★★
Credits 100
Posts 93
Joined 2009-01-14 15:04
17-year member
UID 136661
Gender Male
From 湖南
Status Offline
Question for the OP: how were all those key values under CLSID obtained?
Forum Jump: