This script requires MS Word.
I think it can work on every windows.
Copy paste the code below into notepad and save it under Close_all_windows.vbs
CODE
'Author Rischip
'Home page [link=http://www.thegrimlinker.com]www.thegrimlinker.com[/link]
'This script closes all open windows on the workstation
'The script does not forcefully close applications
'therefore you will get a Save dialog on text editor apps and the like
'before they close
'This script requires Microsoft Word to be installed on your computer
On Error Resume Next
'check to ensure running under wscript
'if we are not it would be possible
'for the script to kill itself in the
'command window that cscript would have open
'if we are cool, if not relaunch under wscript
If Not LCase(Right(Wscript.FullName, 11)) = "wscript.exe" Then
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "Wscript.exe " & WScript.ScriptFullName , 0, False
WScript.quit
End If
'create Word object
Set objWord = CreateObject("Word.Application")
'get collection of open windows
Set colTasks = objWord.Tasks
'enumerate open windows
'checking for visibility
'verify task is not program manager
'otherwise you will get the logoff/shutdown/restart window
for each objTask in colTasks
If objTask.Visible Then
If Not objTask.Name = "Program Manager" then
colTasks(objTask.Name).Close
End If
End If
next
objWord.Quit
'Home page [link=http://www.thegrimlinker.com]www.thegrimlinker.com[/link]
'This script closes all open windows on the workstation
'The script does not forcefully close applications
'therefore you will get a Save dialog on text editor apps and the like
'before they close
'This script requires Microsoft Word to be installed on your computer
On Error Resume Next
'check to ensure running under wscript
'if we are not it would be possible
'for the script to kill itself in the
'command window that cscript would have open
'if we are cool, if not relaunch under wscript
If Not LCase(Right(Wscript.FullName, 11)) = "wscript.exe" Then
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "Wscript.exe " & WScript.ScriptFullName , 0, False
WScript.quit
End If
'create Word object
Set objWord = CreateObject("Word.Application")
'get collection of open windows
Set colTasks = objWord.Tasks
'enumerate open windows
'checking for visibility
'verify task is not program manager
'otherwise you will get the logoff/shutdown/restart window
for each objTask in colTasks
If objTask.Visible Then
If Not objTask.Name = "Program Manager" then
colTasks(objTask.Name).Close
End If
End If
next
objWord.Quit