Dim objShell,oExec Set objShell = WScript.CreateObject("WScript.Shell") Set objExec = objShell.Exec("C:\Program Files\Alwil Software\Avast4\ashQuick.exe C: D: ") Set oExec = objExec ' 起動を待つ Do Until objShell.AppActivate(objExec.ProcessID) WScript.Sleep 1000 Loop Do Until oExec.Status=1 ' ダイアログの表示を待つ If objShell.AppActivate("avast! 警告") Then WScript.Sleep 100 objShell.SendKeys "%(C)" ' チェストへ移動 End If If objShell.AppActivate("エラー・メッセージ") Then objShell.SendKeys "~" ' ドライブのないものを無視 End If Loop