Batch File for Firing Up AX 2012
I use my laptop for many things – actually, scratch that, I use it for everything. Because of this, I load everything possible onto my laptop – media editing software, Visual Studio, all the Office tools (including Project, Visio, SharePoint Designer and Workspace) and, of course, I loaded SQL so I could load Dynamics AX 2012.
I have a Sony VAIO Z Series laptop, which is easily the lightest and best laptop I’ve ever owned, and it’s been perfoming great, but I was noticing it was starting to get warm and the hard drive light was on more than necessary. When I looked at the Resource Monitor I noticed AX, SQL and SQL Reporting Services were taking up about 1 GB of my 8 GB of memory. They weren’t consuming much in the way of processor time, but I thought, if I don’t need them running all the time (which I don’t), why not shut them down and create a batch file to kick off AX when I need it.
I changed my services settings to set SQL, SQL Agent, SQL Reporting Services and AX to manual so they wouldn’t have to boot up right away (this saved me a few seconds on boot-up too). Now my laptop is cooler than before and the battery life is better, and if I need to launch AX, I’m only 40 seconds away from it starting, thanks to this batch file.
net start mssqlserver
net start sqlserveragent
net start reportserver
net start AOS60$01
I saved that text as a file called StartAX.bat and placed it in my main document folder. I then created a shortcut file on my desk to that batch file so I could have it run with admin privileges by default. To do this, click the “Advanced” properties under the shortcut file to have it run with elevated privileges. I also renamed it to “Start AX” so it’s pretty easy to see what I need to do on my desktop.
I also created a batch file to stop all the services, and it only has one line – net stop mssqlserver /y – that will shut down all associated services.
As I was trying to put this together I noticed the commands for SQL had changed from previous versions, and I didn’t realize at first that AX would launch just by typing the ax32 command. I hope this helps you to be able to run AX on your laptop without having to overheat your machine when you’re not using it.