• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2787
  • Last Modified:

Issue running AutoIT script as Scheduled Task / SCCM Task Sequence

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)
	If Not WinActive($title,$text) Then WinActivate($title,$text)

Run('C:\Program Files\Microsoft\MDOP MBAM\MBAMClientUI.exe')
_WinWaitActivate("Microsoft BitLocker Administration and Monitoring","")

Open in new window

  • 2
2 Solutions
Joe Winograd - EE Fellow & MVEDeveloperCommented:
I suggest you upgrade to the current version of AutoHotkey:

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:
Run,"C:\Program Files\Microsoft\MDOP MBAM\MBAMClientUI.exe"
  IfWinExist,Microsoft BitLocker Administration and Monitoring
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
aidebAuthor Commented:
I actually found that manage-bde was able to achive this.

Thanks for the help though.
Joe Winograd - EE Fellow & MVEDeveloperCommented:
You're welcome. And thanks to you for posting the solution that worked for you...and for the points! Regards, Joe
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now