Sign in to follow this  
Followers 0
Pumagaju

newbie help needed

4 posts in this topic

I am in the process of converting my install scripts from IBM Rational Visual Test to AutoIt3. But I've come across another command I cannot replicate with AutoIt.

Currently, in my install script, I use a global string variable called COMMAND$ like this:

IF command$="ADMIN" Then

This allows me to use the same install script for multiple installs. For example, this install has options for REGULAR user and ADMIN.

The actual command line would then look like this:

mtrun.exe install.pc6 /c "ADMIN"

So how would I handle this routine with AutoIt?

Thanks,

Share this post


Link to post
Share on other sites



Look at IsAdmin()

If IsAdmin() Then

Look at RunAsSet() in the help file for running processes as Admin. The help file will explain some more.

Or perhaps look the directive #RequireAdmin to prompt for admin if needed. Add to top of script if you use the directive.

:)

Share this post


Link to post
Share on other sites

Look at IsAdmin()

If IsAdmin() Then

Look at RunAsSet() in the help file for running processes as Admin. The help file will explain some more.

Or perhaps look the directive #RequireAdmin to prompt for admin if needed. Add to top of script if you use the directive.

:)

Thanks MHz, I'm not looking for Admin level access... but a command that can decipher based on input which install to run. This is perhaps a better example:

IF COMMAND$="life" THEN
 serial$="xxx"
 Mpath$="M:\premium pro life"
 appshortname$="Premium Pro Life"
 wintitle$="2005-2006 Premium Pro Life/PC System Files V100" 
END IF

IF COMMAND$="muni" THEN
 serial$="xxxx"
 Mpath$="M:\premium pro muni"
 appshortname$="Premium Pro Municipal"
 wintitle$="2005-2006 Premium Pro Municipal System Files V100" 
END IF

With VT I can decipher with a command line switch:

mtrun.exe install.pc6 /c "life"

which then calls the "life" portion of the install.

Is this type of logic available in AutoIt? I imagine it is but I'm new enough to not be asking the right questions?

Thanks,

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

There is a variable called $cmdline, it is an array where the zero index is the count of parameters, and each index after that is each parameter.

So if you had mtrun.exe install.pc6 /c "life", $cmdline would equal [3, "install.pc6", "/c", "life"] for the mtrun file. (if it were theoretically an AutoIt script)

Edited by Richard Robertson

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