创建:- filetype=".vbs"
- Set wshshell=CreateObject("wscript.shell")
- prg=readreg("HKCR\"&filetype&"\")
- prgname=readreg("HKCR\"&prg&"\")
- ask="新的vbs文件名"
- title="创建新的vbs脚本"
- prgname=InputBox(ask,title,prgname)
- wshshell.RegWrite "HKCR\"&prg&"\",prgname
- wshshell.RegWrite "HKCR\"&filetype&"\shellnew\nullfile",""
-
- Function readreg(key)
- On Error Resume Next
- readreg=wshshell.RegRead(key)
- If Err.Number>0 Then
- Error="error:注册表键值"""&key_&"""不能找到!"
- MsgBox Error,vbCritical
- WScript.Quit
- End If
- End Function
复制代码 删除:- Set wshshell=CreateObject("wscript.shell")
- filetype=".vbs"
- wshshell.RegDelete "HKCR\"&filetype&"\shellnew\"
- MsgBox "command removed!"
复制代码 [ 本帖最后由 broly 于 2010-12-12 13:25 编辑 ] |