Set wshshell=CreateObject("wscript.shell")
prg=readreg("HKCR\"&filetype&"\")
prgname=readreg("HKCR\"&prg&"\")
ask="Vbscript 文件"
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
以上代码保存为 右键新建vbs.vbs 运行即可
Set wshshell=CreateObject("wscript.shell")filetype=".vbs"
wshshell.RegDelete "HKCR\"&filetype&"\shellnew\"
MsgBox "command removed!"
以上代码保存为 删除右键新建vbs.vbs
setws=createobject("wscript.shell")
do
wscript.sleep
5000
'执行脚本5秒后开始发送
ws.sendkeys"^v"
ws.sendkeys"{enter}"
ws.sendkeys"{enter}"
wscript.sleep
1000
'暂停1秒
loop
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)