Sign in to follow this  
Followers 0
Joon

help converting vbscript to AutoIt

12 posts in this topic

#1 ·  Posted (edited)

I'm trying to convert following vbscript to AutoIt.

Set IIsWebVDirObj = GetObject("IIS://LocalHost/W3SVC/1/Root/iq")
IIsWebVDirObj.AppCreate3 2, "IQAppPool", True
IIsWebVDirObj.AppFriendlyName = "iq"
IIsWebVDirObj.SetInfo

Below code fails on line 2, AppCreate3. I have no idea how to make AutoIt to pass 3 parameters.

Thank you.

$IIsWebVDirObj = ObjGet("IIS://LocalHost/W3SVC/1/Root/iq")
$IIsWebVDirObj.AppCreate3 (2, "IQAppPool", True)
$IIsWebVDirObj.AppFriendlyName = "iq"
$IIsWebVDirObj.SetInfo
Edited by Joon

Share this post


Link to post
Share on other sites



I'm trying to convert following vbscript to AutoIt.

Set IIsWebVDirObj = GetObject("IIS://LocalHost/W3SVC/1/Root/iq")
IIsWebVDirObj.AppCreate3 2, "IQAppPool", True
IIsWebVDirObj.AppFriendlyName = "iq"
IIsWebVDirObj.SetInfo

Below code fails on line 2, AppCreate3. I have no idea how to make AutoIt to pass 3 parameters.

Thank you.

$IIsWebVDirObj = ObjGet("IIS://LocalHost/W3SVC/1/Root/iq")
$IIsWebVDirObj.AppCreate3 (2, "IQAppPool", True)
$IIsWebVDirObj.AppFriendlyName = "iq"
$IIsWebVDirObj.SetInfo
Try -1 instead of "True". I seem to recall the VBScript boolean True versus AutoIt gave me trouble at some point before.

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Failed on passing 1 as true value.

The requested action with this object has failed.:

$IIsWebVDirObj.AppCreate3 (2, "IQAppPool", 1)

$IIsWebVDirObj.AppCreate3 (2, "IQAppPool", 1)^ ERROR

Share this post


Link to post
Share on other sites

-1


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

Failed on passing 1 as true value.

The requested action with this object has failed.:

$IIsWebVDirObj.AppCreate3 (2, "IQAppPool", 1)

$IIsWebVDirObj.AppCreate3 (2, "IQAppPool", 1)^ ERROR

You know, I screwed up a lot of algebra problems in my day by accidentally dropping negative signs...

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Oh, I didn't look closely enough. I tried with -1 and give me same result.

$IIsWebVDirObj.AppCreate3 (2, "IQAppPool", -1)

$IIsWebVDirObj.AppCreate3 (2, "IQAppPool", -1)^ ERROR

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Oh, I didn't look closely enough. I tried with -1 and give me same result.

$IIsWebVDirObj.AppCreate3 (2, "IQAppPool", -1)

$IIsWebVDirObj.AppCreate3 (2, "IQAppPool", -1)^ ERROR

Rats. And you are using IIS 6 minimum (the VBScript works)?

:D

P.S. Should you be creating it as a pooled process (IAppMode = 2)? This example uses OUT_OF_PROCESS = 1 for IAppMode.

:D

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Rats. And you are using IIS 6 minimum (the VBScript works)?

:D

Yes, I'm using IIS6. Windows 2003 R2 64bit to be exact.

And vbscript works.

Share this post


Link to post
Share on other sites

Yes, I'm using IIS6. Windows 2003 R2 64bit to be exact.

And vbscript works.

I was afraid of that. All I can tell you so far is that AutoIt doesn't have a problem with more than two parameters. Things like this work fine:
$oExcel.WorkBooks.Open($sFilePath, Default, $fReadOnly, Default, $sPassword, $sWritePassword)

Hopefully someone smarter will come along...

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Do you know the full number of parameters of IIsWebVDirObj.AppCreate3 ?

With VBS to AutoIT conversion i noticed that you have to list the optional parameters for the function to work.

For example if there is an 4 parameter:

$IIsWebVDirObj.AppCreate3 (2, "IQAppPool",true) wont work but

$IIsWebVDirObj.AppCreate3 (2, "IQAppPool", true, 0) may work.

I couldnt find any documentation on that function but dont have time to dig more.

As a workaround you can use fileinstall to include the vbs script and the use run to tun it from autoit.

Share this post


Link to post
Share on other sites

http://msdn.microsoft.com/en-us/library/ms525258.aspx

seems to be right

Share this post


Link to post
Share on other sites

Good possibility that the quotes in that line have to remain so try this

$IIsWebVDirObj.AppCreate3 (2, '"IQAppPool"', True)


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

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