Board logo

标题: [原创]添加删除右键新建菜单 [打印本页]

作者: joyn     时间: 2008-6-7 20:47    标题: [原创]添加删除右键新建菜单

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'                                          Start      By    Joyn
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''       
        On Error Resume Next
Set WSHObj = WScript.CreateObject ("wscript.shell")
regpath = "HKCR\"
recount = MsgBox ("┌────────────────┐"&Chr (13)_
&"┆"&Space (24)&"Joyn 制作"&Space (23)&"┆"&Chr (13)_
&"┊"&Space (12)&"添加右键 新建文件类型"&Space (11)&"┆"&Chr (13)_
&"┊"&space (5)&"""是"" 添加 ""否"" 卸载 ""取消"" 退出 "&Space (5)&"┆"&Chr (13)_
&"└────────────────┘",67,"添加新建文件类型    Joyn")
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'                                对按扭进行判断
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If recount = 6 Then
                CreateType ()
        Else If recount = 7 Then
                Str = InputBox ("输入要取消的文件类型"&Chr (13)_
                &"只需输入后缀名不用加点","取消类型    Joyn","vbs")
                If str = "" Then:WScript.Echo "请正确输入":WScript.Quit:End If
                a = wshobj.RegRead (regpath&"."&str&"\mark")
                If Err.Number = 0 Then
                        'WScript.Echo "存在":WScript.Quit
                        wshobj.Run "cmd.exe"
                        wshobj.AppActivate "cmd.exe"
                        wscript.sleep 500
                        wshobj.SendKeys "reg delete "+regpath+"."+str+"\ /f~"
                        wshobj.SendKeys "reg delete "+regpath+str+"file\ /f~"
                        wshobj.SendKeys "gpupdate~"
                        wshobj.SendKeys "exit~"
                        WScript.Echo "已删除."
                Else
                        'WScript.Echo "不存在":WScript.Quit
                        wshobj.Run "cmd.exe"
                        wshobj.AppActivate "cmd.exe"
                        wscript.sleep 500
                        wshobj.SendKeys "reg delete "+regpath+"."+str+"\shellnew\ /f~"
                        wshobj.SendKeys "gpupdate~"
                        wshobj.SendKeys "exit~"
                        WScript.Echo "已删除."
                End If
                        Else If recount = 2 Then
                                'WScript.Echo "取消"
                End If
        End If       
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'                                调用注册过程
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub CreateType ()
        str = InputBox ("输入要添加的文件类弄"&Chr (13)_
        &"只需输入后缀名不用加点","添加类型    Joyn","vbs")
        If str = "" Then:WScript.Echo "请正确输入":WScript.Quit:End if
        a = wshobj.RegRead (regpath&"."&str&"\")
        If Err.Number = 0 Then
                wshobj.RegWrite regpath&"."&str&"\Shellnew\Nullfile",""
                wshobj.SendKeys "{F5}"
                WScript.Echo "添加完成":WScript.Quit
                Else
                        wshobj.RegWrite regpath&"."&str&"\",str&"file":str1 = regpath&"."&str&"\"
                        wshobj.RegWrite str1&"shellnew\Nullfile",""
                        wshobj.RegWrite str1&"Mark",""
                        wshobj.RegWrite regpath&str&"file\",str&" 文件":str1 = regpath&str&"file\"
                        wshobj.RegWrite str1&"Mark",""
                        wshobj.RegWrite str1&"shell\open\","打开"&str&"文件(&OP)"
                        wshobj.RegWrite str1&"shell\open\command\","""notepad.exe"" ""%1"""
                        wshobj.RegWrite str1&"DefualtIcon\",""
                        WScript.Echo "添加完成"                       
        End If
End Sub
WScript.Sleep 500
wshobj.Exec "RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters"
Set wshobj = Nothing
WScript.Quit
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'                                     The        End
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''





在右键新建文件类型 OR 取消新建类型
对了这两天为什么上不了论坛~~是不是维护呀~~也没有个公告什么的确 - -!





欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) Powered by Discuz! 2.5