Sign in to follow this  
Followers 0
SorryButImaNewbie

Different between Exit and WinKill

7 posts in this topic

Hello dear readers!

This is just an enquiry about the 2 commands from the title

What I want to know that other then the outcome (that both can possibly used to close a program) what are the differences? WinKill can of course be used to close windows not just programms, like Exit. I know the WinKill is more like a forced close, but what does that actually means? I'm just curious what you guys use WinKill for generally? I use it to close some popup windows in my script, is that a good idea? or you suggest something else?

Thank you

Share this post


Link to post
Share on other sites



Exit    

Terminates the script.

Exit [return code]

 

do you mean WinKill and WinClose?


if @error Then
	MsgBox(262192,"",@ComputerName&" slaps "&@UserName&" around a bit with a large trout!")
	EndIf

>Exit code: 0

REAL search results

"Yeah yeah yeah, patience. How long will that take?"  -Ed Gruberman

Share this post


Link to post
Share on other sites

that too, I thought about using WinKill to kill my programs from/window and with that it also terminate the script. But yeah WinKill/WinClose would be a similar question in essence

Share this post


Link to post
Share on other sites

my point is that Exit does not close programs or windows, it ONLY terminates the script.


if @error Then
	MsgBox(262192,"",@ComputerName&" slaps "&@UserName&" around a bit with a large trout!")
	EndIf

>Exit code: 0

REAL search results

"Yeah yeah yeah, patience. How long will that take?"  -Ed Gruberman

Share this post


Link to post
Share on other sites

Yes, But if you have a GUI in your script, it can be done in a way that a WinKill terminates the script as well, I guess however that explanation of the difference between WinKill/WinClose would be more usefull to me. 

I get your point but dont see how it is relavent, as terminating the script closes its window, so I think they are at least somewhat similar, (not as similar as WinClose and WinKill so I agree that it would have been a better question for this thread)

Share this post


Link to post
Share on other sites

with WinClose(), if the window or program that you close needs further interaction, such as a "would you like to save changes" , then the dialog will popup waiting for you.

with WinKill(), it will close the window or program without asking you to save changes, so no popups or anything else keeping the window from closing (force close)

another way to force close a program is ProcessClose(), which i use if i need to kill a program that has multiple windows without having to close each window separately.

:alien:


if @error Then
	MsgBox(262192,"",@ComputerName&" slaps "&@UserName&" around a bit with a large trout!")
	EndIf

>Exit code: 0

REAL search results

"Yeah yeah yeah, patience. How long will that take?"  -Ed Gruberman

Share this post


Link to post
Share on other sites

Thank you (actually the main reason why I asked because I saw that a function of mine which was wrote to exit from a program used winkill, I figured that it isn't the best solution, so after a bit of digging I changed it to work with ProcessClose(), but also it lead me to start and ask this question so I also learn something :) )

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