althurm Posted December 4, 2012 Share Posted December 4, 2012 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? Link to comment Share on other sites More sharing options...
spudw2k Posted December 5, 2012 Share Posted December 5, 2012 (edited) 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) _WinAPI_SetWindowLong($hWnd,$GWL_STYLE,BitXOR($style,$WS_POPUP)) 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 December 6, 2012 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now