WMI ScriptOMatic tool for AutoIt

142 posts in this topic

Posted (edited)

This is the AutoIt's version of Microsoft Scriptomatic tool. Which took me some hours to rewrite (yes, yes, I'm not such a fast script writer).

If you don't know what Scriptomatic is, see:

http://www.microsoft.com/technet/scriptcen...s/scripto2.mspx

This version is written in AutoIt script AND it produces an AutoIt script !

Requirements:

- AutoIt version 3.1.1.8 (or higher)

- Some knowledge about WMI

Download at: http://www.autoitscript.com/forum/index.ph...amp;showfile=29

Have fun!

Regards,

-Sven

EDIT 17-APR-2005: Updated with suggestions from gafrost and some other bugfixes. Now REQUIRES AutoIt beta version 3.1.1.8 or higher !

EDIT 17-APR-2005 11PM: For the generated script you have now options for dialog, text or HTML output.

EDIT 14-MAY-2005: Fixed a tiny bug: If the output contained an array-variable, I incorrectly used the index 1. But arrays start from index 0. Thanks gafrost !

Edit: Uploaded JdeB's fixed version for the latest beta release. - Jon.

Edited by Jon

Share this post


Link to post
Share on other sites



Posted

Using Autoit version 3.1.1.7 and got the following errors after compiling

and then trying to run it.

Share this post


Link to post
Share on other sites

Posted (edited)

Link to Download?

Just a bit to ansy in the pants I guess. Testing it now. Did a IP4RotueTable Class, looks good!

Edited by MSLx Fanboy

Share this post


Link to post
Share on other sites

Posted

Share this post


Link to post
Share on other sites

Posted

3.1.1.++

<{POST_SNAPBACK}>

This script is currently running very, very slow, because I had to make a work-around for the bug in the COM code.

I hope jpm has time to release 3.1.1.8 soon.

Regards,

-Sven

Share this post


Link to post
Share on other sites

Posted

WMI ScriptOAutoIT is awesome!!!!

Share this post


Link to post
Share on other sites

Posted (edited)

Wow, this is gorgeous.

Excellent work... your code is beautiful!

Edited by Insolence

Share this post


Link to post
Share on other sites

Posted

...Hum...Now that VBScript works in AU3, anyone know how to pull an MD5 hash? I'm going crazy not being able to do it natively, without having to get an elephant to jump through a hoop.

Share this post


Link to post
Share on other sites

Posted

Well you could be cool and use a PHP script to do it, but I suppose that's shoving an elephant through a hoop :)

Share this post


Link to post
Share on other sites

Posted (edited)

Pretty slick once I remembered to get the latest au3check

ran across a small problem

select the wmi for bios

saved the script

and tried to run it and got the following error:

C:\Documents and Settings\Gary\My Documents\bios.au3 (13) : ==> Expected a variable in user function call.: 
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) 
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", $wbemFlagReturnImmediately ^ ERROR
C:\Documents and Settings\Gary\My Documents\bios.au3 (13) : ==> Illegal text at the end of statement (one statement per line).: 
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) 
Incorrect parameters to object property !

original code lines produced:

$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", _ 
                                                    $wbemFlagReturnImmediately + $wbemFlagForwardOnly)

either of the following fixes the error:

$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", _
                                                    ($wbemFlagReturnImmediately + $wbemFlagForwardOnly))
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", _
                                                    BitOR($wbemFlagReturnImmediately,$wbemFlagForwardOnly))

Edit: downloaded your latest, that fixed that problem.

Edited by gafrost

Share this post


Link to post
Share on other sites

Posted

Well you could be cool and use a PHP script to do it, but I suppose that's shoving an elephant through a hoop :)

<{POST_SNAPBACK}>

That's actually what I thought of originally, but my partner in crime (the other programmer for this script), pointed it to me that we need to do get an md5 offline...

Share this post


Link to post
Share on other sites

Posted

Pretty slick once I remembered to get the latest au3check

ran across a small problem

select the wmi for bios

saved the script

and tried to run it and got the following error:

....

Edit: downloaded your latest, that fixed that problem.

<{POST_SNAPBACK}>

gaforst,

Yeah, that's the nast COM problem I was talking about. It doesn't accept mathematical expressions.

I've fixed that in my AutoIt.exe, but I am not allowed to release new AutoIt.exe's, so I made a dirty work-around in Scriptomatic.au3.

Regards,

-Sven

Share this post


Link to post
Share on other sites

Posted

found a but in the OpenScript

old code

;********************************************************************
;* OpenScript
;********************************************************************

Func OpenScript()

   $strTmpName=FileOpenDialog("Open Script",@DesktopDir,"AutoIt3 Scripts (*.au3)")

   If not @error and $strTmpName <> "" then
    If FileExists($strTmpName) then
        GUICtrlSetData($GUI_AST_ScriptCode,FileRead($strTmpName))
    EndIf
   EndIf
   
EndFunc

code that works

;********************************************************************
;* OpenScript
;********************************************************************

Func OpenScript()

   $strTmpName=FileOpenDialog("Open Script",@DesktopDir,"AutoIt3 Scripts (*.au3)")

   If not @error and $strTmpName <> "" then
    If FileExists($strTmpName) then
        GUICtrlSetData($GUI_AST_ScriptCode,FileRead($strTmpName,FileGetSize($strTmpName)))
    EndIf
   EndIf
   
EndFunc

Share this post


Link to post
Share on other sites

Posted

Suggestion:

In SaveScript:

$strTmpName=FileSaveDialog("Save Script",@DesktopDir,"AutoIt3 Scripts (*.au3)",16)

I think it would be better to have a default name, for example:

$strTmpName=FileSaveDialog("Save Script",@DesktopDir,"AutoIt3 Scripts (*.au3)",16,GUICtrlRead ( $GUI_WMI_Classes ))

but then that's just my opinion

Share this post


Link to post
Share on other sites

Posted

Suggestion:

..etc...

but then that's just my opinion

<{POST_SNAPBACK}>

gafrost,

Thanks for your feedback. I've added your suggestions to the program, and I did also some other minor bugfixes. I'll upload the new version.

Regards,

-Sven

Share this post


Link to post
Share on other sites

Posted

...Hum...Now that VBScript works in AU3, anyone know how to pull an MD5 hash?  I'm going crazy not being able to do it natively, without having to get an elephant to jump through a hoop.

<{POST_SNAPBACK}>

I created one for you,

See: http://www.autoitscript.com/forum/index.php?showtopic=10590

Regards,

-Sven

Share this post


Link to post
Share on other sites

Posted

running 3.1.1.8

i get the following error when running this script

line 200 (file "<my path here>\Scriptomatic.au3"):

If $objQualifierDictiionary.Exist("dynamic") Then

If $objQualifierDictiionary.E^ERROR

Error: Unable to parse line.

to avoid confusion <my path here> is not what it says.. i just didnt feel like typing out my path.

thanks

Share this post


Link to post
Share on other sites

Posted

running 3.1.1.8

i get the following error when running this script

line 200 (file "<my path here>\Scriptomatic.au3"):

If $objQualifierDictiionary.Exist("dynamic") Then

If $objQualifierDictiionary.E^ERROR

Error: Unable to parse line.

to avoid confusion <my path here> is not what it says.. i just didnt feel like typing out my path.

thanks

<{POST_SNAPBACK}>

Hmm, that's odd. Could you do another try with AutoIt beta version 3.1.1.18 ? (from: http://www.autoitscript.com/forum/index.php?showtopic=10256)

It *could* be a bug in the COM code, however I'm not sure.

I assume the double "ii" in the word "..Dictiionary" is a typo while typing out the error message ?

Regards,

-Sven

Share this post


Link to post
Share on other sites

Posted

figured it out myself, it needs to be an offset of 0 not 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now