naru Posted August 27, 2017 Share Posted August 27, 2017 (edited) I have code for kill windows/pop up but not working My code is : $abc = ("Done:2: See logs for more details.") $pqr = ("Msg:2.2: (Save) :- Server was unable to process request.") Winkill ("PS", $abc) or ("PS", $pqr) Also tried with : $abc = ("Done:2: See logs for more details.") $pqr = ("Msg:2.2: (Save) :- Server was unable to process request.") Winkill ("PS", $abc) Winkill ("PS", $pqr) My full code is : $abc = ("Done:2: See logs for more details.") $pqr = ("Msg:2.2: (Save) :- Server was unable to process request.") ; Some Code is here Winwait ("PS", $abc) or Winwait ("PS", $pqr) Winkill ("PS", $abc) or Winkill ("PS", $pqr) ; Some Code is here But not working Edited August 27, 2017 by Nareshm Link to comment Share on other sites More sharing options...
alienclone Posted August 27, 2017 Share Posted August 27, 2017 your code is not working because it is incorrect. https://www.autoitscript.com/autoit3/docs/functions/WinKill.htm https://www.autoitscript.com/autoit3/docs/intro/lang_operators.htm If @error Then MsgBox(262192, "", @ComputerName & " slaps " & @UserName & " around a bit with a large trout!") EndIf "Yeah yeah yeah patience, how long will that take?" -Ed Gruberman REAL search results | SciTE4AutoIt3 Editor Full Version Link to comment Share on other sites More sharing options...
naru Posted August 27, 2017 Author Share Posted August 27, 2017 1 hour ago, alienclone said: your code is not working because it is incorrect. https://www.autoitscript.com/autoit3/docs/functions/WinKill.htm https://www.autoitscript.com/autoit3/docs/intro/lang_operators.htm @alienclone What is incorrect in my code ? Link to comment Share on other sites More sharing options...
alienclone Posted August 27, 2017 Share Posted August 27, 2017 winkill("title", "text") or winkill("title", "text") If @error Then MsgBox(262192, "", @ComputerName & " slaps " & @UserName & " around a bit with a large trout!") EndIf "Yeah yeah yeah patience, how long will that take?" -Ed Gruberman REAL search results | SciTE4AutoIt3 Editor Full Version Link to comment Share on other sites More sharing options...
alienclone Posted August 27, 2017 Share Posted August 27, 2017 $abc = ("Done:2: See logs for more details.") $pqr = ("Msg:2.2: (Save) :- Server was unable to process request.") Winkill("PS", $abc) AND Or Winkill("PS", $pqr) might work better, or $abc = ("Done:2: See logs for more details.") $pqr = ("Msg:2.2: (Save) :- Server was unable to process request.") Winkill("PS", $abc) Winkill("PS", $pqr) If @error Then MsgBox(262192, "", @ComputerName & " slaps " & @UserName & " around a bit with a large trout!") EndIf "Yeah yeah yeah patience, how long will that take?" -Ed Gruberman REAL search results | SciTE4AutoIt3 Editor Full Version Link to comment Share on other sites More sharing options...
alienclone Posted August 27, 2017 Share Posted August 27, 2017 are you running your script in the SciTE editor? it should tell you where a problem in a script is. when i tried to run your script in SciTE it gave errors directly in script... $abc = ("Done:2: See logs for more details.") $pqr = ("Msg:2.2: (Save) :- Server was unable to process request.") Winkill ("PS", $abc) or ("PS", $pqr) error: unbalanced paranthesis expression. error: syntax error error: Statement cannot be just an expression. it also shows where the halt is in the console readout at bottom of editor, indicated by the "^" below the line of code... "C:\Users\alienclone\New AutoIt v3 Script.au3"(8,30) : error: unbalanced paranthesis expression. Winkill ("PS", $abc) or ("PS", ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "C:\Users\alienclone\New AutoIt v3 Script.au3"(8,30) : error: syntax error Winkill ("PS", $abc) or ("PS", ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "C:\Users\alienclone\New AutoIt v3 Script.au3"(8,32) : error: Statement cannot be just an expression. Winkill ("PS", $abc) or ("PS", $pqr ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "C:\Users\alienclone\New AutoIt v3 Script.au3"(8,37) : error: Statement cannot be just an expression. Winkill ("PS", $abc) or ("PS", $pqr) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\alienclone\New AutoIt v3 Script.au3 - 4 error(s), 0 warning(s) If @error Then MsgBox(262192, "", @ComputerName & " slaps " & @UserName & " around a bit with a large trout!") EndIf "Yeah yeah yeah patience, how long will that take?" -Ed Gruberman REAL search results | SciTE4AutoIt3 Editor Full Version Link to comment Share on other sites More sharing options...
Developers Jos Posted August 27, 2017 Developers Share Posted August 27, 2017 (edited) 4 minutes ago, alienclone said: are you running your script in the SciTE editor? it should tell you where a problem in a script is. Only when the Full version of SciTE4AutoIt3 is separately installed! Jos Edited August 27, 2017 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
alienclone Posted August 27, 2017 Share Posted August 27, 2017 oh shoot, i forgot that i had the full separate version installed. @Nareshm i would suggest following the link in @Jos's signature and install the full editor. If @error Then MsgBox(262192, "", @ComputerName & " slaps " & @UserName & " around a bit with a large trout!") EndIf "Yeah yeah yeah patience, how long will that take?" -Ed Gruberman REAL search results | SciTE4AutoIt3 Editor Full Version Link to comment Share on other sites More sharing options...
naru Posted August 27, 2017 Author Share Posted August 27, 2017 @alienclone Link to comment Share on other sites More sharing options...
alienclone Posted August 27, 2017 Share Posted August 27, 2017 perfect, the message box tells the error, "one statement per line". so we would put each command on separate lines... $abc = ("Done:2: See logs for more details.") $pqr = ("Msg:2.2: (Save) :- Server was unable to process request.") Winkill("PS", $abc) Winkill("PS", $pqr) if either one or both of those windows exist this should kill them. If @error Then MsgBox(262192, "", @ComputerName & " slaps " & @UserName & " around a bit with a large trout!") EndIf "Yeah yeah yeah patience, how long will that take?" -Ed Gruberman REAL search results | SciTE4AutoIt3 Editor Full Version Link to comment Share on other sites More sharing options...
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