我室友天天晚上玩游戏可大动静了睡不着觉我就想编一个VBS让他在22:30-00:00的时候玩不了这个游戏,程序如下、
Dim wsh
sTart = "22:30"
eTart = "23:59"
Set wsh = CreateObject("Wscript.Shell")
Tims = FormatDateTime(Time,4)
chTST tims
Sub chTST(tim)
sT = FormatDateTime(sTart,4)
eT = FormatDateTime(eTart,4)
If (tim>sT) And (tim<eT) Then
wsh.Run "taskkill /f /im dota2launcher.exe",,True
If tim > eT Then
WScript.Quit
End If
WScript.Sleep 15000
Sel = Chr(34)&WScript.ScriptFullName&Chr(34)
Wsh.Run Sel,,True
End If
End Sub
我自己试了一下 这个程序只能在规定的22:30到零点打开,其余时间打不开,我想设置的是把VBS添加到开机自动启动的文件夹里去然后让它在十点半自动运行关闭游戏,求大神指点,怎么改
Dim wsh
sTart = "22:30"
eTart = "23:59"
Set wsh = CreateObject("Wscript.Shell")
Tims = FormatDateTime(Time,4)
chTST tims
Sub chTST(tim)
sT = FormatDateTime(sTart,4)
eT = FormatDateTime(eTart,4)
If (tim>sT) And (tim<eT) Then
wsh.Run "taskkill /f /im dota2launcher.exe",,True
If tim > eT Then
WScript.Quit
End If
WScript.Sleep 15000
Sel = Chr(34)&WScript.ScriptFullName&Chr(34)
Wsh.Run Sel,,True
End If
End Sub
我自己试了一下 这个程序只能在规定的22:30到零点打开,其余时间打不开,我想设置的是把VBS添加到开机自动启动的文件夹里去然后让它在十点半自动运行关闭游戏,求大神指点,怎么改
