?
Solved

Issue running AutoIT script as Scheduled Task / SCCM Task Sequence

Posted on 2013-06-21
4
Medium Priority
?
2,687 Views
Last Modified: 2013-06-24
I need to be able to kick off MBAM encryption on our Windows 7 desktops. There is no command line utility for doing this so I must use the GUI.

This AutoIT script will work if it is run normally - i.e. I double click on it
It will also work within SCCM if I set it to allow the user to interact with it.

Ideally I need to run this during an SCCM Task sequence - which will not allow it to run interactively. I thought therefore I would use SCCM to deploy a Scheduled task that would run when the user logs in for the first time - but that fails too. The application launches but the keypresses are not executed.

Here is my code...

Thanks in advance!


Func _WinWaitActivate($title,$text,$timeout=0)
	WinWait($title,$text,$timeout)
	If Not WinActive($title,$text) Then WinActivate($title,$text)
	WinWaitActive($title,$text,$timeout)
EndFunc

Run('C:\Program Files\Microsoft\MDOP MBAM\MBAMClientUI.exe')
_WinWaitActivate("Microsoft BitLocker Administration and Monitoring","")
Send("{TAB}{TAB}{CTRLDOWN}s{CTRLUP}{ALTDOWN}s{ALTUP}{ALTDOWN}co")

Open in new window

0
Comment
Question by:aideb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 55

Accepted Solution

by:
Joe Winograd, EE MVE 2015&2016 earned 750 total points
ID: 39265978
I suggest you upgrade to the current version of AutoHotkey:
http://www.autohotkey.com/

If you have older scripts, select the ANSI 32-bit install rather than Unicode 64-bit.

Create an AHK file, e.g. [mbam.ahk], with this code:
SetTitleMatchMode,2
Run,"C:\Program Files\Microsoft\MDOP MBAM\MBAMClientUI.exe"
Loop
{
  IfWinExist,Microsoft BitLocker Administration and Monitoring
  Break
}
Send {Tab}{Tab}^s!s!co

Open in new window

After installing AutoHotkey, it will own the AHK file type, so all you need to do in Task Scheduler is point it to [mbam.ahk], or whatever you called it. It never ceases to amaze how results vary from one person to the next, but I can tell you that the code above (for a different executable and sending different keystrokes) works perfectly here in the W7 Task Scheduler. Regards, Joe
0
 
LVL 29

Assisted Solution

by:matrixnz
matrixnz earned 750 total points
ID: 39268310
0
 
LVL 2

Author Closing Comment

by:aideb
ID: 39271985
I actually found that manage-bde was able to achive this.

Thanks for the help though.
0
 
LVL 55

Expert Comment

by:Joe Winograd, EE MVE 2015&2016
ID: 39272012
You're welcome. And thanks to you for posting the solution that worked for you...and for the points! Regards, Joe
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

On some Windows 7 (SP1) computers, Windows Update becomes super slow even the computer is reasonably fast.  There's one solution that seemed to have worked well for me (after trying a few other suggested solutions).
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.
Progress
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question