'this is file extension the command
'should generate
filetype=".vbs"
'connect to WScript.Shell registry access
set WSHShell = CreateObject("WScript.Shell")
'read in the name of vbs-section
prg = ReadReg("HKCR/"&tiletype&"/")
prgname = ReadReg("HKCR/"&prg&"/")
'ask for a new name
ask = "What Should be the name for new VBScript script"
title="新建 Vb 脚本"
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:Registry-key"""&key&"""could not be found!!"
MsgBox error.vbCritical
WScript.Quit
end if
end function
'should generate
filetype=".vbs"
'connect to WScript.Shell registry access
set WSHShell = CreateObject("WScript.Shell")
'read in the name of vbs-section
prg = ReadReg("HKCR/"&tiletype&"/")
prgname = ReadReg("HKCR/"&prg&"/")
'ask for a new name
ask = "What Should be the name for new VBScript script"
title="新建 Vb 脚本"
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:Registry-key"""&key&"""could not be found!!"
MsgBox error.vbCritical
WScript.Quit
end if
end function