Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Politely Close all open windows

 
Logged in as: Guest
arrSession:exec spGetSession 2,16,48266
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> Post a VBScript >> Politely Close all open windows
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Politely Close all open windows - 6/13/2007 8:37:07 AM   
  Rischip


Posts: 468
Score: 2
Joined: 3/26/2007
Status: offline

      

< Message edited by Rischip -- 6/14/2007 6:28:00 AM >


_____________________________

Rischip
Author of - The Grim Linker
 
 
Revisions: 1 | Post #: 1
 
 RE: Politely Close all open windows - 6/14/2007 1:53:32 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Very handy.

This chunk:

If Not LCase(Right(Wscript.FullName, 11)) = "wscript.exe" Then
  Set objShell = CreateObject("Wscript.Shell")
  objShell.Run WScript.ScriptFullName , 0, False
  WScript.quit
End If

would re-run the script with whatever the default engine is for that user. In my case, the default engine is CSCript. This means that it would essentially just keep killing itself and starting over. Instead then you should probably have it explicitly run itself with WSCript.exe.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to Rischip)
 
 
Post #: 2
 
 RE: Politely Close all open windows - 6/14/2007 5:52:17 AM   
  Rischip


Posts: 468
Score: 2
Joined: 3/26/2007
Status: offline
Yeah my mistake, I posted it before I fixed it.

Ok, it's fixed.

< Message edited by Rischip -- 6/14/2007 6:30:11 AM >


_____________________________

Rischip
Author of - The Grim Linker

(in reply to ebgreen)
 
 
Revisions: 1 | Post #: 3
 
 RE: Politely Close all open windows - 6/15/2007 5:10:57 AM   
  Fredledingue


Posts: 337
Score: 0
Joined: 5/9/2005
From:
Status: offline
Works like a charm!

And personaly I like the fact that it doesn't requires WMI so that I can run it on my w98++ machine.

_____________________________

Fred

(in reply to Rischip)
 
 
Post #: 4
 
 RE: Politely Close all open windows - 6/15/2007 11:37:29 AM   
  dm_4ever


Posts: 2404
Score: 38
Joined: 6/29/2006
From: Orange County, California
Status: offline
If you're interested in seeing what else can be done with the word document regarding processes check this article out: http://www.microsoft.com/technet/scriptcenter/topics/office/tasks.mspx

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to Fredledingue)
 
 
Post #: 5
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> Post a VBScript >> Politely Close all open windows Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts