zoukankan      html  css  js  c++  java
  • 右键增加"显示/隐藏扩展名"及"显示/隐藏隐藏的文件"菜单的简单实现

    常常会有需要"显示/隐藏扩展名"或"显示/隐藏隐藏的文件"的动作,每次进入文件选项太麻烦,现结合网上的方法,于右键菜单中增加""显示/隐藏扩展名"及"显示/隐藏隐藏的文件"两个选项.如下图.

    image

    一. 首先新增右键菜单,建立Show_Hidden_Switch.reg,内容如下,保存后执行,即可产生"Show / Hide Extention"及"Show / Hide Hidden Files"菜单;

    Windows Registry Editor Version 5.00
     
    [HKEY_CLASSES_ROOT\Directory\Background\shell\Show / Hide Extention]
    @="Show / Hide Extention"
    "HasLUAShield"=""
     
    [HKEY_CLASSES_ROOT\Directory\Background\shell\Show / Hide Extention\command]
    @="cmd.exe /c start C:\\Windows\\Show_Hidden_Ext_Switch.vbs"
     
     
    [HKEY_CLASSES_ROOT\Directory\Background\shell\Show / Hide Hidden Files]
    @="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"

    二. 分别建立vbs指令档Show_Hidden_Ext_Switch.vbs与Show_Hidden_Files_Switch.vbs,并将之置于c:\WINDOWS目录中;

    Show_Hidden_Ext_Switch.vbs內容如下:

    Hidden = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt"
    HiddenTitle = "HKEY_CLASSES_ROOT\Directory\Background\shell\Show / Hide Extention\"
    SHidden = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden"
    SHiddenTitle = ""
    Set Sh = WScript.CreateObject("WScript.Shell")
    St = Sh.RegRead(Hidden)
    If St = 1 Then
    Sh.RegWrite Hidden, 0, "REG_DWORD"
    Sh.RegWrite HiddenTitle, "Hide Extention", "REG_SZ"
    Else
    Sh.RegWrite Hidden, 1, "REG_DWORD"
    Sh.RegWrite HiddenTitle, "Show Extention", "REG_SZ"
    End If
    Sh.SendKeys("{F5}")

    Show_Hidden_Files_Switch.vbs內容如下:

    Hidden = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden"
    HiddenTitle = "HKCR\Directory\Background\shell\Show / Hide Hidden Files\"
    SHidden = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden"
    SHiddenTitle = ""
    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"
    Sh.RegWrite HiddenTitle, "Hide Hidden Files", "REG_SZ"
    Else
    Sh.RegWrite Hidden, 2, "REG_DWORD"
    Sh.RegWrite SHidden, 0, "REG_DWORD"
    Sh.RegWrite HiddenTitle, "Show Hidden Files", "REG_SZ"
    End If
    Sh.SendKeys("{F5}")
  • 相关阅读:
    我的第一个NHibernate示例
    Div+CSS实现表格滚动,JS隐藏和显示Div例子
    VUE 生命周期
    sql AND和OR
    vcloak 隐藏表达式
    sql 多表联查
    SQL 语句解析
    jenkins 使用
    sql 排序(order by)
    sql 基础查询
  • 原文地址:https://www.cnblogs.com/honhwa/p/2105311.html
Copyright © 2011-2022 走看看