Jump to content
Sign in to follow this  

run batch script with title bar disabled

Recommended Posts


Hello all,

I have a batch script that I need to run in a WinPe environment. The script may require some user interaction, so I would like to run it with the title bar of the console removed so that the user has no way of closing/stopping the script midstream (or alternatively the X button greyed out or disabled). Does anyone know how to do this? Maybe by some autoit function?

Share this post

Link to post
Share on other sites

Quick and dirty solution.

#include <WinAPI.au3>
Const $GWL_STYLE = -16
Const $WS_POPUP = 0x80880000

$pid = Run("c:tempbat.bat")
$hWnd = WinWait("C:\Windows\System32\cmd.exe")

$style = _WinAPI_GetWindowLong($hWnd, $GWL_STYLE)

Doesn't block Ctrl+C though.

If you really don't want them to stop it you should consider converting the bat into an autoit script.

Edited by spudw2k

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