Invoking an MMC Snap-in function from Windows command shell: is it possible?

2

I need to execute a MMC Snap-in function from the Command Shell of a Windows computer. I need it to schedule this command in the same Windows PC and executes in background.

Probably this questions could seem a little bit strange but I have a program that creates a debug log only through its MMC Snap-in console. And I need to automatise this task to programatically read this log!

Dows anyone know how to do this?

thanks

robob

Posted 2010-04-23T13:03:54.770

Reputation: 245

Answers

1

You can access the MMC 2.0 Automation Library via COM from Powershell. Possibly nasty, but workable.

To get started with Powershell:

$mmc = New-Object -ComObject MMC20.Application
$mmc.Load("path\to\some.msc")
  1. You'll probably have to be admin.
  2. The API is pretty awful but you should be able to access the data through it. Here's a VB example of extracting stuff from the a snap-in's items.

Dan Fitch

Posted 2010-04-23T13:03:54.770

Reputation: 111

0

Try to use AutoIT:

AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages (e.g. VBScript and SendKeys). AutoIt is also very small, self-contained and will run on all versions of Windows out-of-the-box with no annoying “runtimes” required!

enter image description here

Steve

Posted 2010-04-23T13:03:54.770

Reputation: 2 473