tutor2000 Posted September 1, 2008 Posted September 1, 2008 (edited) I started the script then need to click a button for the program to execute so just starting the program was not an option Generate this as part of your hta generation $hta = $hta &@CRLF& '<script language="VBScript"> ' $hta = $hta &@CRLF& 'Sub RunProgram ' $hta = $hta &@CRLF& 'document.title="Run Program by NewbieServices.com"' $hta = $hta &@CRLF& 'End Sub' $hta = $hta &@CRLF& '</script> ' $hta = $hta &@CRLF& '</head><body> <button onclick="RunProgram">Run Program</button> Now the button will rename the window Then place this in your autoit script Run(@ComSpec & " /c start "&@ScriptDir&"\DumbSubmitMenu.hta",@ScriptDir,@SW_HIDE) ;or whatever the name of your hta is WinWait("DumbSubmit by NewbieServies.com","") WinActivate("DumbSubmit by NewbieServies.com", "") WinMove("DumbSubmit by NewbieServies.com", "", 0, 0, 300, 300) WinSetOnTop("DumbSubmit by NewbieServies.com","",1) while WinExists("DumbSubmit by NewbieServies.com","") sleep(1000) WEnd The program will now wait until the window no longer exists which it doesn't when you click the vbscript button and rename the window Just a new trick I learned as a newbie Rick Edited September 1, 2008 by tutor2000
tutor2000 Posted September 1, 2008 Author Posted September 1, 2008 Clever Just my lazy way of getting around stuff I don't know lolRick
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now