Sign in to follow this  
Followers 0
windsurf

Closing all windows before reboot

4 posts in this topic

HI first post please go easy on me if it's in the wrong place.

please be aware this refers to an NT4 workstation not an XP machine

I have scripted and install for an application which requires me to reboot and login as admin for app to finish install. to this end I wrote an additional script which auto logs the box in one time as admin the script then waits for a few minutes reboots again and user can log in normally and use the application.

My problem is that the the first rebooted is occasionaly halted by those annoying end task boxes which require interaction.

Is there a forecful way to close as windows and stop all processes to reboot cleanly.

Share this post


Link to post
Share on other sites



Wow that was fast, I'll give it a go now,

thanks in advance NeoFox

Share this post


Link to post
Share on other sites

I used Winlist from the help file and add in a line to close the windows, I don't know if it will do what you need but maybe slightly safer than closing all processes

$var = WinList()

For $i = 1 to $var[0][0]
 ; Only display visble windows that have a title
  If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
    WinClose($var[$i][0],"")
  EndIf
Next

Func IsVisible($handle)
  If BitAnd( WinGetState($handle), 2 ) Then 
    Return 1
  Else
    Return 0
  EndIf

EndFunc

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  
Followers 0