iT邦幫忙

0

背景持續Ping的語法和工作排程設定

因為ASA如果太久沒有Traffic,我們的Rounting-based VPN會Drop,因此需要設定一台電腦持續去PING某個IP。
請問如果要在某個Windows 7工作站上,開機登入Windows後到關機前都背景永遠持續執行"PING 8.8.8.8 -t"而不被用戶看到,要怎麼寫BAT/Startup/設定工作排程?

謝謝!

建個監控系統比較方便吧.
suasem iT邦新手 5 級 ‧ 2019-02-19 13:35:56 檢舉
BatToExeConverter工具搭配win內建的工作排程器應該可以
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

0
froce
iT邦大師 1 級 ‧ 2019-02-19 08:14:10

神奇VBS,可以執行指令,但是不跑出視窗。

Dim objShell,objFSO,objFile

Set objShell=CreateObject("WScript.Shell")
Set objFSO=CreateObject("Scripting.FileSystemObject")

'enter the path for your Script
strPath=""

'verify file exists
If objFSO.FileExists(strPath) Then
'return short path name
    set objFile=objFSO.GetFile(strPath)
    strCMD=""
    
    'Uncomment next line for debugging
    'WScript.Echo strCMD
   
    'use 0 to hide window
    objShell.Run strCMD,0

Else

'Display error message
    WScript.Echo "Failed to find " & strPath
    WScript.Quit
   
End If

path之類的自己改。

我要發表回答

立即登入回答