Jump to content

new to autoit


 Share

Recommended Posts

I created a conditional exe with autoit to detect whether a program was installed and to install it using admin account if it wasn't. It runs great if I sit at the users desk and click on it to run. If I try to add it to a Windows XP logoff script via group policy, the xp logoff process cuts it off before it finishes. I can see the script start and luanch the installer, but then the 'saving network settings box' pops up and i get the Windows logon screen. Any ideas how to allow my script to run at logoff?

Link to comment
Share on other sites

If you have a script, it needs to wait for your autoit program to finish.

And your autoit program needs to wait for an installer program to finish.

What?

The OP wants to know if there is a way to pause the shutdown process while the Autoit script performs an install. Do you know how to do that? If so, please share that info.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

u could use the dos command for cancel shutdown and then let autoit logoff again at the end of your script

Edit: the dos command is Shutdown -a

Edited by zeroZshadow
*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...
Link to comment
Share on other sites

u could use the dos command for cancel shutdown and then let autoit logoff again at the end of your script

Edit: the dos command is Shutdown -a

I tried that- same result. It behaves as if Windows believes the logoff script is complete.

Link to comment
Share on other sites

What?

The OP wants to know if there is a way to pause the shutdown process while the Autoit script performs an install. Do you know how to do that? If so, please share that info.

via Group Policy, you can have a script run before system logs you off. I thought that was what he was doing.

Link to comment
Share on other sites

via Group Policy, you can have a script run before system logs you off. I thought that was what he was doing.

Exactly right. It seems Windows doesn't want me to finish any Autoit exe's though. I've tried placing the exe directly as the loggoff script, having a .bat logoff and calling the exe and even copying the exe to the local drive and calling it locally. I've used dos cmds within the autoit exe to runas and provide admin username and password and I've also tried using the built in Autoit RunAsSet.

Link to comment
Share on other sites

Exactly right. It seems Windows doesn't want me to finish any Autoit exe's though. I've tried placing the exe directly as the loggoff script, having a .bat logoff and calling the exe and even copying the exe to the local drive and calling it locally. I've used dos cmds within the autoit exe to runas and provide admin username and password and I've also tried using the built in Autoit RunAsSet.

odd. Must it be run at logoff? Seems it would be just as effective at logon. I know that's not the answer you're looking for, but just saying that could be an interim work around.
Link to comment
Share on other sites

@Joon,

I think that I see where you are headed now.

Sorry, I just did not understand your first post.

So, the OS launches the AutoIt script like a RunWait and as long as the AutoIt script is waiting for the install to complete, the OS should wait too - is that it?

-MSP-

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Like I said, does your AutoIt program wait for your installer to finish? Post your script if you can.

apolgoies in advance for sloppiness\rookieisms

Opt("WinWaitDelay",100)

Opt("WinTitleMatchMode",4)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

Run('cmd')

If FileExists("c:\windows\IE7\iexplore.exe") Then

WinWait("C:\WINDOWS\system32\cmd.exe","")

If Not WinActive("C:\WINDOWS\system32\cmd.exe","") Then WinActivate("C:\WINDOWS\system32\cmd.exe","")

WinWaitActive("C:\WINDOWS\system32\cmd.exe","")

Send("\\dc01\sources\execss{SHIFTDOWN}`{SHIFTUP}1\adobe\acrobat_reader8.exe{ENTER}")

Else

WinWait("C:\WINDOWS\system32\cmd.exe","")

If Not WinActive("C:\WINDOWS\system32\cmd.exe","") Then WinActivate("C:\WINDOWS\system32\cmd.exe","")

WinWaitActive("C:\WINDOWS\system32\cmd.exe","")

Send("runas{SPACE}/user{SHIFTDOWN};{SHIFTUP}domainname\adminuser\\dc01\sources\execss{SHIFTDOWN}`{SHIFTUP}1\ie7\ie7setup.exe{ENTER}")

WinWait("C:\WINDOWS\system32\cmd.exe","")

If Not WinActive("C:\WINDOWS\system32\cmd.exe","") Then WinActivate("C:\WINDOWS\system32\cmd.exe","")

WinWaitActive("C:\WINDOWS\system32\cmd.exe","")

Send("adminpassword")

EndIf

This runs great and does exactly what I want when I double click it to run, but when I run as logoff script, Windows appears to consider it completed before it is actually finished with its work

Is there something I need to add on tothe end of the script to make it wait until the install is done before closing?

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...