Jump to content

Can AutoIt Run Without a User Logged In?


Recommended Posts

That may be a stupid question, but I'd like to be able to use AutoIt to do a remote install to our departments workstations at night when no one is in (and no one is logged in). We use BigFix to push Microsoft patches, etc. in this manner. I would just use it and do a slient install for this, but this particular app doesn't have slient option.

I set up a script to run the installer and just hit enter, enter, tab/enter, etc. to complete the install. It works fine when I run it. It won't run when I set Bigfix to run it on a computer that has no one logged in. Bigfix runs under the system account, so I don't think this is a rights issue. When I log into the computer as a user to see what's going on the installer pops up and runs through some windows, but ends up hitting some windows that the script isn't set to hit and cancels out. I'm thinking maybe AutoIt can't run without someone logged in.

Is that the case? Thanks for any advice you may have,

Link to comment
Share on other sites

Use WinWait and Control* functions to automate the installation. Functions that require Active Window interaction will fail e.g. Win* Active functions, Mouse* functions and Send.

:whistle:

It sounds like you're saying I need to use WinWait to wait for the window to come up (which would only happen when a user logs in, I'm guessing) and then use control functions. So basically I can't do the install without a user logged in, right?

Link to comment
Share on other sites

So basically I can't do the install without a user logged in, right?

That's not what MHz is saying. You can run the install, as long as your script does not have to use those commands that he pointed out. WinWait will work even though no user is logged in.

I run a number of unattended installs and utilities that work whether or not a user is logged in. In fact, it's quite weird when a user does log in as he will see the gui's of the programs running, even though he did not initiate them...

Edited by jefhal
...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format
Link to comment
Share on other sites

It sounds like you're saying I need to use WinWait to wait for the window to come up (which would only happen when a user logs in, I'm guessing) and then use control functions. So basically I can't do the install without a user logged in, right?

Search the forum for "Service", you will find a lot of people how did it.

RK

"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

Link to comment
Share on other sites

Search the forum for "Service", you will find a lot of people how did it.

RK

It does not have to be a service. I run DIRMS, REGCLEAN, and many other utilities without logging into the remote machine directly. You will need PSEXEC from Sysinternals to launch a program on a remote machine...
...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format
Link to comment
Share on other sites

It does not have to be a service. I run DIRMS, REGCLEAN, and many other utilities without logging into the remote machine directly. You will need PSEXEC from Sysinternals to launch a program on a remote machine...

I use bigfix to launch the script, so that isn't a problem. The problem is getting the script to run when it is launched when no one is logged in. I understand that I somehow need to re-write using WinWait and controls... but when I looked up the help/documentation on WinWait it looked like a function that just waited for a window or something like that. I guess if someone could tell me exactly how to use Winwait to run an exe with no one logged in that would be great. Sorry if that's a stupid question, this is my first experience with autoit...

Link to comment
Share on other sites

I guess if someone could tell me exactly how to use Winwait to run an exe with no one logged in that would be great.

First, you need to create a script the works while you are logged in. Until you have that, there is no need to go further. Once you have that, please publish the code and we can take a look at what might need to be changed to run "unattended".

As for how to use WinWait, the pseudo code might look like this:

Run Setup.exe

Winwait (Wait for the first setup screen)

CtrlClick (Send a click to the "next" button)

Winwait (wait for the next setup screen)

CtrlClick (Send a click to the "finish" button)

I can't test this at home as I don't have WinXP Pro or a domain here, but post some code when you have the script going at all...

...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format
Link to comment
Share on other sites

@jefhal

Thanks for the support

@jay9333

Instead of using Active functions

WinWaitActive('title', 'text')
Send('!y')
oÝ÷ ØjvÞvÞÞy÷âr'§¶°ØZºÚ"µÍÚ[ØZ]
    ÌÎNÝ]IÌÎNË    ÌÎNÝ^    ÌÎNÊBÛÛÛÛXÚÊ   ÌÎNÝ]IÌÎNË    ÌÎNÝ^    ÌÎNË ÌÎNÐ]ÛÌÎNÊB

The difference with the latter is the window only has to exist and a direct click to the control happens. Previous code requires the window to become active and then a keyboard type happens to click the active window control.

Of hand, I'll show this :-:link removed:-:, perhaps over your head, but will run without Active Desktop interaction as the choice of functions makes it so.

Edit:

That script was started with CMenu in Scripts'n'Scraps if interested in the template style and good installer support. :whistle:

Edited by MHz
Link to comment
Share on other sites

  • Moderators
:whistle:, MHz, I clicked on the link and was like ... Damn... Now Jon has color highlighted the syntax for uploaded codes... bad ass... and then an OOPS! ... that's not an autoit url :)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
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
 Share

  • Recently Browsing   0 members

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