WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: archimede on September 27, 2013, 04:50:11 AM

Title: Compiled script ask permission when I close session
Post by: archimede on September 27, 2013, 04:50:11 AM
Hallo.
Windows 7; WinBatch 2008C
I have aproblem with a .exe complied script: when I launch it and it runs, if I close session that script ask me if I want to close the script; If I no answer the system Waits and no close anything.
I want that the system close automatically that program like all other programs... How I can obtain it?
Thank you very much
Title: Re: Compiled script ask permission when I close session
Post by: Deana on September 27, 2013, 07:58:27 AM
You can add IntControl(12,5,0,0,0) to the beginning of your script to tell the script to exit quietly.
Title: Re: Compiled script ask permission when I close session
Post by: archimede on September 27, 2013, 08:13:41 AM
I am reading instructions about Intcontrol ( 12, p1, p2, 0, 0 ); I no see "5" like possible value for p1; can I use it?
I see:
0 popup message to ask to close or not (I tnink the default value)
1 to allow Windows to close the program without warnings
2 to refuse Windows to close application
3 reserved
no other

Can I use 1 instead 5?
Title: Re: Compiled script ask permission when I close session
Post by: Deana on September 27, 2013, 08:29:41 AM
IntControl 12 offers 2 types of flags that can be bitwise Or'd together. The first flag indicates how the handle Windows Exit, the second flag indicates how the handle a WIL Script Termination( i.e. Ctrl+break).

For example if you wanted the following flags:


WindowsExit  = 1 ; Allow Windows to be exited with no warning.
ScriptExit = 4 ; Allow quiet termination.


Then you can either simply add those values together to get 5. OR use the bitwise or operator like this:

Code (winbatch) Select
IntControl(12,1|4,0,0,0)

to achieve the same result.
Title: Re: Compiled script ask permission when I close session
Post by: archimede on September 27, 2013, 08:37:25 AM
You have reason, sorry.
I red not very well.
I tried your solution and that is good.
Thank you very much