Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

WMI ScriptOMatic tool for AutoIt


  • Please log in to reply
101 replies to this topic

#1 SvenP

SvenP

    AutoIt COMposer

  • Developers
  • 639 posts

Posted 17 April 2005 - 01:28 AM

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, 18 December 2006 - 11:50 PM.








#2 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 17 April 2005 - 01:36 AM

Using Autoit version 3.1.1.7 and got the following errors after compiling
and then trying to run it.

SciTE for AutoItDirections for Submitting Standard UDFs

Don't argue with an idiot; people watching may not be able to tell the difference.


#3 MSLx Fanboy

MSLx Fanboy

    Local $Clue = 0

  • Active Members
  • PipPipPipPipPipPip
  • 1,046 posts

Posted 17 April 2005 - 01:39 AM

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, 17 April 2005 - 01:47 AM.

Writing AutoIt scripts since
_DateAdd("d", -2, _NowCalcDate())

#4 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 17 April 2005 - 01:46 AM

3.1.1.++

SciTE for AutoItDirections for Submitting Standard UDFs

Don't argue with an idiot; people watching may not be able to tell the difference.


#5 SvenP

SvenP

    AutoIt COMposer

  • Developers
  • 639 posts

Posted 17 April 2005 - 02:02 AM

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

#6 PerryRaptor

PerryRaptor

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 383 posts

Posted 17 April 2005 - 02:56 AM

WMI ScriptOAutoIT is awesome!!!!

#7 Insolence

Insolence

    Not distastefully arrogant

  • Active Members
  • PipPipPipPipPipPip
  • 1,304 posts

Posted 17 April 2005 - 03:07 AM

Wow, this is gorgeous.

Excellent work... your code is beautiful!

Edited by Insolence, 17 April 2005 - 03:08 AM.

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

#8 MSLx Fanboy

MSLx Fanboy

    Local $Clue = 0

  • Active Members
  • PipPipPipPipPipPip
  • 1,046 posts

Posted 17 April 2005 - 03:45 AM

...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.
Writing AutoIt scripts since
_DateAdd("d", -2, _NowCalcDate())

#9 Insolence

Insolence

    Not distastefully arrogant

  • Active Members
  • PipPipPipPipPipPip
  • 1,304 posts

Posted 17 April 2005 - 03:49 AM

Well you could be cool and use a PHP script to do it, but I suppose that's shoving an elephant through a hoop :)
"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

#10 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 17 April 2005 - 04:44 AM

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, 17 April 2005 - 04:56 AM.

SciTE for AutoItDirections for Submitting Standard UDFs

Don't argue with an idiot; people watching may not be able to tell the difference.


#11 MSLx Fanboy

MSLx Fanboy

    Local $Clue = 0

  • Active Members
  • PipPipPipPipPipPip
  • 1,046 posts

Posted 17 April 2005 - 04:48 AM

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...
Writing AutoIt scripts since
_DateAdd("d", -2, _NowCalcDate())

#12 SvenP

SvenP

    AutoIt COMposer

  • Developers
  • 639 posts

Posted 17 April 2005 - 10:54 AM

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

#13 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 17 April 2005 - 02:30 PM

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

SciTE for AutoItDirections for Submitting Standard UDFs

Don't argue with an idiot; people watching may not be able to tell the difference.


#14 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 17 April 2005 - 03:18 PM

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

SciTE for AutoItDirections for Submitting Standard UDFs

Don't argue with an idiot; people watching may not be able to tell the difference.


#15 SvenP

SvenP

    AutoIt COMposer

  • Developers
  • 639 posts

Posted 17 April 2005 - 04:06 PM

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

#16 SvenP

SvenP

    AutoIt COMposer

  • Developers
  • 639 posts

Posted 18 April 2005 - 07:27 PM

...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

#17 blitzkrg

blitzkrg

    Polymath

  • Active Members
  • PipPipPipPip
  • 232 posts

Posted 29 April 2005 - 02:02 PM

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

#18 SvenP

SvenP

    AutoIt COMposer

  • Developers
  • 639 posts

Posted 29 April 2005 - 10:11 PM

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

#19 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 13 May 2005 - 12:46 PM

see http://www.autoitscript.com/forum/index.php?showtopic=11420

interested in the resolution of this one, would help at work.

SciTE for AutoItDirections for Submitting Standard UDFs

Don't argue with an idiot; people watching may not be able to tell the difference.


#20 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 13 May 2005 - 01:01 PM

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

SciTE for AutoItDirections for Submitting Standard UDFs

Don't argue with an idiot; people watching may not be able to tell the difference.





2 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users


    Google (1)