Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
i wish to create a batch file, which will then be sent to others.
the overall plan islaunch batch file
launch ie
go to web page
wait 10
close ie
luanch ie
go to webpage
wait 10
close ie
batch ends

Not sure how to close proccesses in command not sure if it's even possible. So here is what you want done in two files the first a .bat and the second a .vbs .
.bat file
------
@echo off
cls
start www.google.com
ping -n 1 -w 5000 1.1>nul
start close.vbs
start www.google.com
ping -n 1 -w 5000 1.1>nul
start close.vbs
-----
.vbs file call this close.vbs
----
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'iexplore.exe'")
For Each objProcess in colProcessList
objProcess.Terminate()
Next
--------------Make sure these are both on the same folder. Also this will not work if there default browser is anything other than ie.
Grusomhat

i've seen the taskkill command this works on some machines but not others, but the task kill command could be used

Ok just a simple bat file this time. I had never heard of task kill but thankyou for pointing it out.
--------------------------
@echo off
cls
start www.google.com
ping -n 1 -w 5000 1.1>nul
taskill /pid iexplore.exe
start www.google.com
ping -n 1 -w 5000 1.1>nul
taskkill /pid iexplore
Try that.
Grusomhat

Ok there was a spelling mistake in my last post here it is without the error. This will still however only work if the default browser is ie.
start www.google.com
ping -n 1 -w 10000 1.1>nul
taskkill /pid iexplore.exe
start www.google.com
ping -n 1 -w 10000 1.1>nul
taskkill /pid iexplore.exeif you wanted it to work with firefox i guess you could have this
--------------------------
start www.google.com
ping -n 1 -w 10000 1.1>nul
taskkill /pid iexplore.exe
taskkill /pid firefox.exe
start www.google.com
ping -n 1 -w 10000 1.1>nul
taskkill /pid iexplore
taskkill /pid firefox.exe
---------------------------Grusomhat

the one with vb code works great, cheers taskkill isnt installed by default on all machines so i'll go with the vb one, cheers

If you wanted it to to only ever open in ie heres a different bat file.
---
start iexplore.exe www.google.com
ping -n 1 -w 10000 1.1>nul
start close.vbs
start iexplore.exe www.google.com
ping -n 1 -w 10000 1.1>nul
start close.vbs
----Hope this helps
Grusomhat

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |