Sign in to follow this  
Followers 0
PeterDa

WinWaitActive

6 posts in this topic

Hi All,

I am a very big newbie to AutoIT (about 3hrs !)

I am modifying someone elses code that was previously used on window XP machines. The compiled executable is paused as soon as lusrmgr.msc is run (the utility opens) and then the script is paused (it appear in the task bar with a red X flicking occasionally on it. A RMB clck reveals the paused optuion with a tick.

The code snippet in use is, and is used to delete a temp user that we log into a machine once only. it is the first user in the list! :

Sleep(5000)

Send("#r")

WinWaitActive("Run", "Type the name of a program")

Sleep(2000)

Send("lusrmgr.msc")

Sleep(2000)

Send("{ENTER}")

WinWaitActive("lusrmgr")

Sleep(2000)

Send("{DOWN}")

Sleep(2000)

Send("{TAB}")

Sleep(2000)

Send("{DEL}")

Sleep(2000)

Send("!y")

Sleep(2000)

Send("{ENTER}")

Sleep(2000)

Send("!f")

Sleep(2000)

Send("x")

Sleep(2000)

Send("!{F4}")

WinWaitClose("Run", "Type the name of a program")

Sleep(5000)

Any help would be appreciated.

Thank you

Regards

Peter

Share this post


Link to post
Share on other sites



Hi John,

Thank you for your reply.

I should have mentioned that the script is to be used on Win 7 machines...

I added the mentioned line to the script...It stalls at the same point except the tray icon does not indicate paused !

Any other ideas ?

Thankyou

Regards

Peter

Share this post


Link to post
Share on other sites

Hi John,

I just ran it using 'run as administrator'..you suggested mod worked (well it progressed further, I have some more debugging to do)

Thank you

Regards

Peter

Share this post


Link to post
Share on other sites

Couldn't you do the same thing using the Run command and the command line "net user <username> /delete"? Instead of trying to automate the Local User management console?


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

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