Sign in to follow this  
Followers 0
Pepinghege

Problems with RunAsSet function

4 posts in this topic

I have a serious problem with the RunAsSet function. Yesterday I loaded down the latest versions of AutoIt (v3.2.10.0, NOT Beta 3.2.11!) and SciTE4AutoIt3 20-2-2008. Now my scipts using the RunAsSet function don't work anymore. Formerly I used AutoIt v.3.2.2.0 with the corresponding SciTE-Version. I read the change-history and learned, that I possibly had to update my scripts. I didn't read something about the RunAsSet-Function.

Now with the new Versions installed, when typing the code, SciTE doesn't suggest me anymore the RunAsSet-Function. It rather suggests me two new functions RunAs and RunAsWait. So I thought: Okay, using just ONE function for running a program under another user account is even simpler, nice new feature! So I tried to look up the help file for some explanation. But the help file v3.2.10.0 has no hints about RunAs and RunAsWait. In fact, it says: Use RunAsSet if you want to run a program under another user account. So I tried to compile my unchanged script, which still uses the RunAsSet function. The Compilation caused no errors. But the exe-File ended up with the error, that RunAsSet is an unknown function.

So I tried the new RunAs and RunAsWait functions, which SciTE suggested me. Since there is no information in the help file, I used the RunAs function in the way SciTE suggested it to me:

RunAs($user, $domain, $password, $profile_flag, $RunCommand, $dir, $window_flag)

This ended up in the error message: Incorrect number of parameters in function call.

In another posting here in the forum I read something about planned RunAs and RunAsWait functions in the beta version. But I definitely don't use the beta version. I have installed the current version 3.2.10.0. Anyway this sounds to me as a version confusion.

Actually I don't need to use the current AutoIt version 3.2.10.0. My old version 3.2.2.0 worked very well for me. I just took the new version, because it was available. So I uninstallled v3.2.10.0 and reinstalled 3.2.2.0. Unfortunately I don't have anymore the corresponding SciTE-Version for this AutoIt v3.2.2.0 (When downloading the new Version, I have overwritten the older file. Folks, I'll never do that again!). Using the latest SciTE4AutoIt3 20-2-2008 with AutoIt v3.2.2.0 also ends in an error. The compiled exe says, that the script can not be loaded.

What can I do to get my scripts running again under another user account? Or rather: where can I get the old SciTE4AutoIt3 Version, which fits to AutoIt v3.2.2.0?

Share this post


Link to post
Share on other sites



Welcome to AutoIt Forums,

The reason you may have beta functions suggested by Scite is because you would have beta definitions loaded. You need to run UpdateDefs.exe to select Production (3.2.10.0) definitions so that you will see RunAsSet suggested. You may also see a shortcut in your start menu to switch definitions. It sounds that you maybe mixing some of your story up as I doubt that AutoIt 3.2.10.0 would recognize the beta functions unless the Devs did something very sneaky.

Then possibly a bug fix to RunAsSet is causing some headaches to you existing scripts. AutoIt keeps an archive at the bottom of the download page. I do not know of any Scite4AutoIt3 archive so you may have some problems going back with Scite, but I doubt much has changed with any luck between the versions to hinder a return.

:)

Share this post


Link to post
Share on other sites

Thank you, MHz, for your answer. I tried the UpdateDefs.exe, but it didn't help. My problem indeed was a mixture of different versions. As I wrote, I downloaded BOTH: AutoIt v3.2.10.0 AND Scite4AutoIt3 20-02-2008. After installing both programs, the problems with the RunAs functions occur. Even compiling directly with aut2exe over commandline produced the error, that RunAsSet() is an unknown function and RunAs() respectively RunAsWait() have problems with the number of given arguments. Although I thought I was working with v3.2.10.0 it really seemed to be the beta 3.2.11. UpdateDefs.exe didn't "downdate" the definitions and AutoIt-Functions.

After uninstalling ALL and just installing AutoIt v3.2.10.0 without extra SciTE4AutoIt all is fine again! The SciTE4AutoIt version, which comes along with the AutoIt package suits all my purposes.

Share this post


Link to post
Share on other sites

There is a bug with the SciTe4AutoIT3 8-3-2008 installer where is actually installs the Aut2Exe.exe version 3.2.11.1 over the top of your 3.2.10.0 aut2exe.eve file.

If you actually type RunAsSe it does pick it up as a function... But ofcourse, when you compile it (which uses the newly installed 3.2.11.1 compiler) that function doesn't work...

I've loaded a bugtrac for this: http://svn.autoitscript.com/trac/ticket/167

JayMan

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