0

AVG ウイルス対策保護を途中で停止してから開始する必要があるバッチ スクリプトを作成しています。コマンドラインのみを使用してそれを行う方法はありますか?

4

1 に答える 1

1

わかりました - このようなものが欲しいと思います。防弾ではありませんが、開始する必要があります。

Set myshell = WScript.CreateObject("WScript.Shell")
Dim cmd

REM Do your pre-AVG-stop commands here

REM Now stop AVG using the 'taskkill' command.  Note that this command assumes 
REM that the name of the process is "avgscanx".  You should verify that is true.
REM You also may need to play around with the parameters for 'taskkill'.  Run
REM 'taskkilll /?' in a cmd window to see the various options.  You may also want
REM to add some code to verify that taskkill was successful.

taskkill /IM "avgscanx"

REM Do your post-AVG-stop commands here.

REM Now, let's restart AVG.
REM Modify the command line below for your specific use of AVG.
REM And, again, you may want to add some code to verify that AVG started.

cmd = """avgscanx"" /parameter1 /parameter2 /etc"
myshell.Run(cmd,0,true)

最後に 1 つ。PowerShell はバッチよりもはるかに強力で柔軟であるため、PowerShell への切り替えを検討することをお勧めします。

于 2012-08-17T17:39:11.253 に答える