Jump to content

Recommended Posts

Posted

Hi!

(they suggested me to post it in this forum)

Could anyone help me out with converting simple vbs script to au3 script.

Here is the vbs script content:

------------------------------------------------------

Const ALL_USERS = True

Set objService = GetObject("winmgmts:")

Set objSoftware = objService.Get("Win32_Product")

errReturn = objSoftware.Install("C:\SomeApplication.msi", , ALL_USERS)

MsgBox "Done"

--------------------------------------------------------

Here is my attempt to convert it to AutoIt:

--------------------------------------------------------

Const $ALL_USERS = 1

$objService = ObjGet("winmgmts:")

$objSoftware = $objService.Get("Win32_Product")

$errReturn = $objSoftware.Install("C:\SomeApplication.msi", , $ALL_USERS)

MsgBox(0,"","Done")

--------------------------------------------------------

This au3 script gives me an error.

I also used VBS2AutoIt_Converter to try to find my error, but VBS2AutoIt_Converter does pretty much what I did, so I could not detect the error.

If, however, I replace

$errReturn = $objSoftware.Install("C:\SomeApplication.msi", , $ALL_USERS)

with

$errReturn = $objSoftware.Install("C:\SomeApplication.msi")

it does work, but I would like to be able to keep ALL_USERS option. Anyone could help me find out what is wrong in line and how to correct it?

$errReturn = $objSoftware.Install("C:\SomeApplication.msi", , $ALL_USERS)

Thanks in advance,

Strah

Posted

(they suggested me to post it in this forum)

Your not using AutoItX so someone suggested wrong. Please use your post in the other forum. :shocked:

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...