打造自己的鼠标右键

以下问价存放位置均为c:\reg文件夹下

 

1.新建任意类型文件

注册表文件 AnyType.reg

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.atef]
@="AnyType_EggFile"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.atef\ShellNew]
"Command"="\"c:\\reg\\AnyType.vbs\" \"%1\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AnyType_EggFile]
@="新建文件"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AnyType_EggFile\DefaultIcon]
@="%SystemRoot%\\System32\\WScript.exe,2"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AnyType_EggFile\shell\open\command]
@="\"c:\\reg\\AnyType.vbs\" \"%1\""

 

vsb文件 AnyType.vbs

'检查参数的总数。
If WScript.Arguments.Count <> 1 Then
  WScript.Quit()
End If
'获取起始目录的路径。
strBaseDir = Left(WScript.Arguments(0), InStrRev(WScript.Arguments(0), "\"))
strFilesLine = InputBox("请输入文件的名称和扩展名,每个文件之间请用分号隔开", "新建", "")
If strFilesLine = "" Then
    WScript.Quit()
End If
DoCreate(strFilesLine)

Sub DoCreate(strNewFilesLine)
    Set objShell = CreateObject("WScript.Shell")
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    On Error Resume Next
    arrayFiles = Split(strNewFilesLine, ";")
    For Each strFile in arrayFiles
        objFSO.CreateTextFile strBaseDir & strFile, False
    Next
End Sub

 

2.批量新建文件夹

注册表文件 MultiDir.reg

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.mdef]
@="MultiDir_EggFile"

[HKEY_CLASSES_ROOT\.mdef\ShellNew]
"Command"="\"c:\\reg\\MultiDir.vbs\" \"%1\""

[HKEY_CLASSES_ROOT\MultiDir_EggFile]
@="批量文件夹"

[HKEY_CLASSES_ROOT\MultiDir_EggFile\DefaultIcon]
@="C:\\WINDOWS\\System32\\shell32.dll,3"

[HKEY_CLASSES_ROOT\MultiDir_EggFile\shell]

[HKEY_CLASSES_ROOT\MultiDir_EggFile\shell\open]

[HKEY_CLASSES_ROOT\MultiDir_EggFile\shell\open\command]
@="\"c:\\reg\\MultiDir.vbs\" \"%1\""

 

vbs文件 MultiDir.vbs

Option Explicit

Dim objShell, objFSO
Dim strBaseDir, strDirsLine
'创建对象。
Set objShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
'检查参数的总数。
If WScript.Arguments.Count <> 1 Then
  WScript.Quit()
End If
'获取起始目录的路径。
strBaseDir = Left(WScript.Arguments(0), InStrRev(WScript.Arguments(0), "\"))
'输入所有要新建的目录名。
strDirsLine = InputBox("请输入目录名称,每个目录之间请用分号隔开", "多目录", "New Dir")
If strDirsLine = "" Then
    WScript.Quit
End If
'根据用户输入的目录名称,创建所有的目录。
DoCreate(strDirsLine)

'获取每个文件夹的名称,然后分别创建它们。
Sub DoCreate(strNewDirsLine)
    Dim strDirName
    Dim nFrom, nTo
    '初始化数据。
    nFrom = 1
    nTo = 1
    '依次创建每个目录。
    while (nTo <> 0)
        nTo = Instr(nFrom, strNewDirsLine, ";")
        if 0 = nTo Then
            strDirName = Mid(strNewDirsLine, nFrom)
        else
            strDirName = Mid(strNewDirsLine, nFrom, nTo - nFrom)
        End If
        '创建目录。
        CreateDirectories(strBaseDir & strDirName)
        '更新nFrom的位置。       
        nFrom = nTo + 1
    Wend
End Sub

'创建多级目录。strDirPath为目录的全路径。
Sub CreateDirectories(strDirPath)
    Dim strDir
    Dim nFrom, nTo
    '初始化数据。
    nFrom = 1
    nTo = 1
    '依次创建每级目录。
    while (nTo <> 0)
        nTo = Instr(nFrom, strDirPath, "\")
        if 0 = nTo Then
            strDir = strDirPath
        else
            strDir = Left(strDirPath, nTo - 1)
        End If
        '创建该级目录。
        If Not objFSO.FolderExists(strDir) Then
            objFSO.CreateFolder(strDir)
        End If
        '更新nFrom的位置。
        nFrom = nTo + 1
    Wend
End Sub

 

3.显示/隐藏文件

注册表文件 SuperHidden.reg

REGEDIT4

[HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\SuperHidden]
@="{00000000-0000-0000-0000-000000000012}"

[HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-000000000012}\InProcServer32]
@=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,\
  68,64,6f,63,76,77,2e,64,6c,6c,00
"ThreadingModel"="Apartment"

[HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-000000000012}\Instance]
"CLSID"="{3f454f0e-42ae-4d7c-8ea3-328250d6e272}"

[HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag]
"method"="ShellExecute"
"Param1"="c:\\reg\\SuperHidden.vbs"
"command"="显示/隐藏"
"CLSID"="{13709620-C279-11CE-A49E-444553540000}"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"ShowSuperHidden"=dword:00000000
"Hidden"=dword:00000002

 

vbs文件 SuperHidden.vbs

'Show/Hide System Files by www.5x54.com

Dim WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")
sTitle1 = "SSH=0"
sTitle2 = "SSH=1"

if WSHShell.RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden") = 1 then

WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden", "0", "REG_DWORD"
WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden", "2", "REG_DWORD"
WSHShell.SendKeys "{F5}+{F10}e"
'WSHShell.Popup "Poof, they're gone!", 1, sTitle1, vbInformation

else

WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden", "1", "REG_DWORD"
WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden", "1", "REG_DWORD"
WSHShell.SendKeys "{F5}+{F10}e"
'WSHShell.Popup "Here they are!", 1, sTitle2, vbInformation

end if

Set WSHShell = Nothing
WScript.Quit(0)

 

 

使用方法 将上面的代码存为相应的类型文件 然后统一放到C:\REG文件夹下 导入文件夹下的注册表文件即可!

你可能感兴趣的:(职场,鼠标,休闲)