Sign in to follow this  
Followers 0
frankpintosr

Convert VB to AutoIT

4 posts in this topic

Hey All,

I am a total noob, sorry in advance. I found a VB script and am trying to convert it to Autoit. I will include the VB script, and what I have so far. Please take a look. Please try to make your answers as simple as possible, I am seriously new at this and trying to get the hang. I am running on Vista. It is not working yet, so what is wrong/missing? Thank you!!

VB Script as Posted

strComputer = "localhost"

If Not strComputer = "" Then

strComputer = trim(strComputer)

set objAltirisAgent = createobject ( "Altiris.AeXNSClient", strComputer )

ignoreBlockouts = 1

sendIfUnchanged = 1

objAltirisAgent.SendBasicInventory sendIfUnchanged, ignoreBlockouts

End If

[u][b]Converted to AutoIT (So Far)[/[/u]b]
#RequireAdmin
dim $computer
$computer = "localhost"
$objAltirisAgent = ObjCreate ("Altiris.AeXNSClient", $computer)
With $objAltirisAgent
    .ignoreBlockouts = 1
    .sendIfUnchanged = 1
EndWith

Share this post


Link to post
Share on other sites



ignoreBlockouts and sendIfUnchanged seem to be variables.

Try this

#RequireAdmin

$strComputer = "localhost"
If $strComputer <> "" Then
    $strComputer = StringStripWS($strComputer, 3)
    $objAltirisAgent = ObjCreate ( "Altiris.AeXNSClient", $strComputer )
    If Not @error Then
        $ignoreBlockouts = 1
        $sendIfUnchanged = 1
        $objAltirisAgent.SendBasicInventory ( $sendIfUnchanged, $ignoreBlockouts )
    EndIf
EndIf

:D

Share this post


Link to post
Share on other sites

I think all you need there is

#RequireAdmin
Global $computer = "localhost", $ignoreBlockouts = 1, $sendIfUnchanged = 1
$objAltirisAgent = ObjCreate ("Altiris.AeXNSClient", $computer)
$objAltirisAgent.SendBasicInventory ($sendIfUnchanged, $ignoreBlockouts)

That's just going by the posted code. If you can provide a link to the page you found it on, there may be more information there.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Thank you both, I was able to use both of them. I got it working right before my boss walked in and told me we don't need to add that piece. :-)

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
Sign in to follow this  
Followers 0