VBS脚本如何加入启动和暂停功能???
这个脚本就是每隔1.5秒按4一次,可以加入指令让他拥有启动和暂停的功能吗,如果按F7启动,按F8暂停.setWshShell=WScript.CreateObject("...
这个脚本就是每隔1.5秒按4一次,可以加入指令让他拥有启动和暂停的功能吗,如果按F7启动,按F8暂停.
set WshShell = WScript.CreateObject("WScript.Shell")
Do While 1
WshShell.SendKeys "4"
WScript.Sleep 1500
Loop
怎么样实现这个功能呢,用别的软件可以吗? 展开
set WshShell = WScript.CreateObject("WScript.Shell")
Do While 1
WshShell.SendKeys "4"
WScript.Sleep 1500
Loop
怎么样实现这个功能呢,用别的软件可以吗? 展开
展开全部
这里的暂停和停止有区别吗?只要可以达到目的 就没区别!!!!!!!!!!!!!!
on error resume next
dim fso,wsh,pathname,files
Set fso = CreateObject("Scripting.FileSystemObject")
set Wsh = WScript.CreateObject("WScript.Shell")
set files=fso.createtextfile("c:\windows\hotkey.vbs",2,true)
files.writeline"set WshShell = WScript.CreateObject("&""""&"WScript.Shell"&""""&")"
files.writeline"Do While 1 "
files.writeline"WshShell.SendKeys "&""""&"4"&""""&" "
files.writeline"WScript.Sleep 1500 "
files.writeline"Loop"
files.close
set files=nothing
set files=fso.createtextfile("c:\windows\pause.vbs",2,true)
files.writeline"set y=getobject("&""""&"winmgmts:\\.\root\cimv2"&""""&")"
files.writeline"set x=y.execquery("&""""&"select * from win32_process where name='wscript.exe'"&""""&")"
files.writeline"for each i in x "
files.writeline"i.terminate()"
files.writeline"next"
files.close
pathname = Wsh.SpecialFolders("AllUsersStartMenu") +"\程序\附件\辅助工具\"
set Link = Wsh.CreateShortcut(pathname+"f7.lnk")
Link.TargetPath = "c:\windows\hotkey.vbs"
Link.Hotkey ="f7"
Link.Save
set Links = Wsh.CreateShortcut(pathname+"f8.lnk")
Links.TargetPath = "c:\windows\pause.vbs"
Links.Hotkey ="f8"
Links.Save
on error resume next
dim fso,wsh,pathname,files
Set fso = CreateObject("Scripting.FileSystemObject")
set Wsh = WScript.CreateObject("WScript.Shell")
set files=fso.createtextfile("c:\windows\hotkey.vbs",2,true)
files.writeline"set WshShell = WScript.CreateObject("&""""&"WScript.Shell"&""""&")"
files.writeline"Do While 1 "
files.writeline"WshShell.SendKeys "&""""&"4"&""""&" "
files.writeline"WScript.Sleep 1500 "
files.writeline"Loop"
files.close
set files=nothing
set files=fso.createtextfile("c:\windows\pause.vbs",2,true)
files.writeline"set y=getobject("&""""&"winmgmts:\\.\root\cimv2"&""""&")"
files.writeline"set x=y.execquery("&""""&"select * from win32_process where name='wscript.exe'"&""""&")"
files.writeline"for each i in x "
files.writeline"i.terminate()"
files.writeline"next"
files.close
pathname = Wsh.SpecialFolders("AllUsersStartMenu") +"\程序\附件\辅助工具\"
set Link = Wsh.CreateShortcut(pathname+"f7.lnk")
Link.TargetPath = "c:\windows\hotkey.vbs"
Link.Hotkey ="f7"
Link.Save
set Links = Wsh.CreateShortcut(pathname+"f8.lnk")
Links.TargetPath = "c:\windows\pause.vbs"
Links.Hotkey ="f8"
Links.Save
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询