Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: terminate terminating a WinBatch script intcontrol ctrl break
I have a couple of batches which are constantly running during an NT user session. Whenever that user logs out, he is presented with several dialogs which ask "OK to terminate batch file." User always clicks 'yes'.
Is there any way to prevent that "OK to terminate" dialog box? I have looked at IntControl(1005) but am miffed about how or if to use it.
IntControl(12,1,0,0,0)at the top of each of the relevant WBT files.
This allows "quiet termination" when the user logs off.
IntControl(12,4,0,0,0)to exit WinBatch quietly.
IntControl(12,8,0,0,0)
We strongly suggest that you completely debug the batch file before doing this.
Intcontrol(12,5,0,0,0) Intcontrol(67,0,0,0,0)To protect a script from terminating, use some variation of IntControl(12...)
I usually use:
IntControl(12,9,0,0,0)The 9 is derived from adding the 8+1 options (see help file).
Can there be something I've overlooked or misunderstood as all the documentation indicates this should work?
Even if you have not set up a Cancel button on your WIL Dialog, unless otherwise defined, there is always a Cancel which you need to intercept by redefining the :Cancel label.
Something like:
NPCSAuthFormat=`WWWDLGED,5.0` NPCSAuthCaption=Strcat(station, ` : NPCS Authentication for Windows NT`) NPCSAuthX=57 NPCSAuthY=76 NPCSAuthWidth=182 NPCSAuthHeight=94 NPCSAuthNumControls=5 NPCSAuth01=`22,22,64,DEFAULT,STATICTEXT,DEFAULT,"Username"` NPCSAuth02=`22,46,64,DEFAULT,STATICTEXT,DEFAULT,"Password"` NPCSAuth03=`100,22,64,DEFAULT,EDITBOX,Username,""` NPCSAuth04=`100,46,64,DEFAULT,EDITBOX,PW_user,""` NPCSAuth05=`60,72,64,DEFAULT,PUSHBUTTON,DEFAULT,"OK",1` ButtonPushed=Dialog("NPCSAuth") ;DA MAGIC BELOW: :CANCEL Message("All","Done")There's more info on this at:
Article ID: W13001
Filename: Terminate or Prevent Terminate Winbatch.txt
File Created: 2017:08:29:12:01:06
Last Updated: 2017:08:29:12:01:06