Page 1 of 1 1
Topic Options
#92275 - 2003-06-27 04:34 AM closing internet explorer windows...
Matthew Aires Offline
Lurker

Registered: 2003-06-27
Posts: 2
I am a complete noob when it comes to kixtart but I have managed to create a simple script that restarts my windows 2000 machine once a day to close the internet explorer windows that i open through batch files... theres about 45 of em open... anyway i was wondering if there was an easy way to close those windows with kixtart... automatically (something that bypases the "are you sure you want to exit" dialog box) something that closes the active window would work as well. Thanks for any help in advance.

~Matt

Top
#92276 - 2003-06-27 04:58 AM Re: closing internet explorer windows...
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
whacky idea here, hows about you download TLIST.EXE and KILL.EXE from the net, then run this script that searches for instances of iexplore.exe and whacks them ...

code:
break on

$TEMP = "%TEMP%\TLIST.TMP"

if exist($TEMP)
del $TEMP
endif

shell '%comspec% /c tlist | findstr /i "iexplore.exe" >$TEMP'

if open(1,$TEMP) = 0
$line = ReadLine(1)
while @ERROR=0
if $line
$pid = val(substr($line,1,instr($line," ")))
if $pid
shell '%comspec% /c kill $pid'
endif
endif
$line = readline(1)
loop
$=close(1)
endif

if exist($TEMP)
del $TEMP
endif

exit 1

-Shawn

Top
#92277 - 2003-06-27 06:02 AM Re: closing internet explorer windows...
Matthew Aires Offline
Lurker

Registered: 2003-06-27
Posts: 2
Warned you that i was a complete noob...
but thanks very much for the solution works like a charm!

~Matt

Top
#92278 - 2003-06-27 09:16 AM Re: closing internet explorer windows...
masken Offline
MM club member
*****

Registered: 2000-11-27
Posts: 1222
Loc: Gothenburg, Sweden
lol, I think someone is trying to make some money on some ad-scheme [Razz]
_________________________
The tart is out there

Top
#92279 - 2003-06-27 09:42 AM Re: closing internet explorer windows...
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
Or wanting a quick way to close down all the porn site windows FAST before the Wife or Boss comes in. [Wink]
Top
#92280 - 2003-06-27 10:37 AM Re: closing internet explorer windows...
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
EnumProcess() will do this also.

as well as WMIKill(), FindProc, EndProc()
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#92281 - 2003-06-27 01:53 PM Re: closing internet explorer windows...
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Since you posted the question in the COM forum, here is the COM way to do it...



$objShell=CreateObject("Shell.Application")
$objWindows=$objShell.Windows
For $Index = 0 to $objWindows.Count-1
    $objWindows.Item($Index).Quit
Next

[Smile]

Top
#92282 - 2003-06-27 03:58 PM Re: closing internet explorer windows...
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
thanks chris.
I was about to post it too.

the benefit with that is that it also can kill the hidden windows that do not show up in tasklists.
_________________________
!

download KiXnet

Top
#92283 - 2003-06-27 10:21 PM Re: closing internet explorer windows...
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
However, a QUIT and a KILL are different animals. If a Java process has hung the IE windows it may be possible for this COM method to allow the window to keep running. A KILL process would probably have a better chance of actually closing all Windows.
Top
#92284 - 2003-06-27 10:30 PM Re: closing internet explorer windows...
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
right on that one.
although, the quit should be as good as alt+F4 or logging off.
it asks do you want to wait for it to finish or just end in this situation.

dunno...
quess it depends what you are after.
_________________________
!

download KiXnet

Top
#92285 - 2003-06-30 08:58 AM Re: closing internet explorer windows...
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
Did we scare you off Matthew?
Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 657 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.07 seconds in which 0.034 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org