Windows下AT命令使用

來源:互聯網
上載者:User

最近由於項目的持續化整合系統在構建完成後,需要將構建出的檔案進行病毒掃描,我們選擇的殺毒軟體是卡巴斯基kav2012。但是由於我們的CI系統使用的是Windows Server 08 R2版本,無法安裝kav2012。無奈之下只能選擇在另一台機器上面安裝Windows案頭系統+kav2012,並且在CI系統的指令碼中加入at命令,來達到運程式控制制案頭系統來進行病毒掃描。

at 命令使用文法如下:
at \\computername time /interactive | /every:date,.../next:date,... command
at \\computername id /delete | /delete/yes

 

首先,需要保證能夠通過機器名ping通這台機器,在win7下,需要檢查防火牆的設定,可以通過下面這篇文章來設定:(轉自http://technet.microsoft.com/en-us/library/cc749323(WS.10).aspx)

Nobody Can Ping My Computer8 out of 13 rated this helpful - Rate this topic

Updated: February 18, 2010

Applies To: Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista

A common step in troubleshooting connectivity situations is to use the Ping tool to ping the IP address of the computer to which you are trying to connect. When you ping, you send an ICMP Echo message (also known as an ICMP Echo Request message) and get an ICMP Echo Reply message in response. By default, Windows Firewall does not allow incoming ICMP Echo messages, and therefore the computer cannot send an ICMP Echo Reply in response.

Enabling incoming ICMP Echo messages will allow others to ping your computer. However, it also leaves your computer vulnerable to the types of attacks that use ICMP Echo messages. Therefore, we recommended that you enable the Allow incoming echo request setting temporarily, and then disable it when it is no longer needed.

To enable ICMP Echo messages, create new inbound custom rules to allow ICMPv4 and ICMPv6 Echo Request packets.

To enable ICMP Echo Request for ICMPv4 and ICMPv6
  1. In the Windows Firewall with Advanced Security snap-in, click Inbound Rules in the tree, and click New Rule in the Actions Pane.

  2. Click Custom and click Next.

  3. Click All programs and click Next.

  4. For Protocol type, select ICMPv4.

  5. Click Customize for Internet Control Message Protocol (ICMP) settings.

  6. Click Echo Request, click OK, and then click Next.

  7. Under Which local IP address does this rule match? and for Which remote IP address does this rule match click either Any IP address orThese IP Addresses. If you click These IP addresses, specify the IP addresses and click Add, then click Next.

  8. Click Allow the connection, and then click Next.

  9. Under When does this rule apply?, click the active profile, any or all profiles (Domain, Private, Public) to which you want this rule to apply, and then click Next.

  10. For Name type a name for this rule and for Description an optional description. Click Finish.

  11. Repeat steps for ICMPv6, selecting ICMPv6 for Protocol Type instead of ICMPv4.

If you have active connection security rules, it is also helpful for troubleshooting purposes to exempt ICMP from the IPsec requirements temporarily. To do this, in the Windows Firewall with Advanced Security snap-in, in the Properties dialog box, click the IPsec Settings tab and click Yes to Exempt ICMP from IPsec. This step is only necessary if you have active connection security rules on the computer that you are trying to ping.

 

之後,可以運行at \\computername:

如果出現Access is denied的提示,就需要到這台\\computername的機器上面配置一下運行at的帳號了:

會出現如下對話方塊來改變運行AT的帳號:

配置好之後,at命令應該可以返回指定機器上面狀態為active的job了:

 

好了,下面就可以使用如下at命令來遠端控制kav進行病毒掃描了:

C:\Users\Administrator>at \\WIN-SRJUT8CLLUL 17:33 "C:\Program Files\Kaspersky Lab\Kaspersky Anti-Virus 2012\avp.com"   SCAN /RA:C:\ScanReport\log.txt \\DailyBuildHost

其中,SCAN, /RA都是kav的命令列介面avp.com的參數:

 

 

\\DailyBuildHost是持續化整合服務器構建出來,需要進行病毒掃描的路徑

 

掃描的log的內容如下:

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.