Jump to content

Get text from Command window to kill services for USMT automation


r1hundy
 Share

Recommended Posts

Hi there,

I am totally stuck on how to get Auto It to see that the McAfee Framework Service was stopped successfully in the Command prompt, in order to then stop the McAfee McShield and have USMT kick off a Data Migration. I need this to work seamlessly so that just kicking off the script will automate everything.

I have searched the forum and found something about $STDOUT_CHILD, but it is unclear to me as to what I need to do in order to get my script to work. (take pity please, as I have only been using Auto It for about two weeks now) :P

Currently my script looks like the below: Any help or clear idiot (that's me) proof explanations would be greatly appreciated

#include <Process.au3>

#include <Constants.au3>

; Stop McAfee Framework, McShield and Backup User Data via USMT

Local $sUserName = "Username"

Local $sPassword = "Password"

RunAs($sUserName, @ComputerName, $sPassword, 0, "cmd.exe", @SystemDir, @SW_SHOW)

ProcessClose( "fileencryption.exe")

WinWaitActive( "C:\WINDOWS\system32\cmd.exe")

Send("c:", 1)

Send("{ENTER}")

Send("cd %WINDIR%\System32", 1)

Send("{ENTER}")

Send("net stop mcafeeframework", 1)

Send("{ENTER}")

WinWaitActive( "C:\WINDOWS\system32\cmd.exe", "The McAfee Framework Service service was stopped successfully")

Send("net stop mcshield", 1)

Send("{ENTER}")

WinWaitActive( "C:\WINDOWS\system32\cmd.exe", "The McAfee McShield service was stopped successfully.")

WinClose("C:\WINDOWS\system32\cmd.exe", "")

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...