Author Topic: Compiled script ask permission when I close session  (Read 3070 times)

archimede

  • Newbie
  • *
  • Posts: 22
Compiled script ask permission when I close session
« 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

Deana

  • Wilson WindowWare Tech Support
  • Pundit
  • *****
  • Posts: 1183
  • WinBatch® can do it.
    • WinBatch Tech Support Database
Re: Compiled script ask permission when I close session
« Reply #1 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.
Deana F.
Technical Support
Wilson WindowWare Inc.

archimede

  • Newbie
  • *
  • Posts: 22
Re: Compiled script ask permission when I close session
« Reply #2 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?

Deana

  • Wilson WindowWare Tech Support
  • Pundit
  • *****
  • Posts: 1183
  • WinBatch® can do it.
    • WinBatch Tech Support Database
Re: Compiled script ask permission when I close session
« Reply #3 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:

Code: [Select]
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
IntControl(12,1|4,0,0,0)

to achieve the same result.
Deana F.
Technical Support
Wilson WindowWare Inc.

archimede

  • Newbie
  • *
  • Posts: 22
Re: Compiled script ask permission when I close session
« Reply #4 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