[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Issue running AutoIT script as Scheduled Task / SCCM Task Sequence

Posted on 2013-06-21
4
Medium Priority
?
2,725 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 56

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 56

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Six Sigma Control Plans
Suggested Courses

650 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