UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Close All Web Sites    
 
   
bakersburg9
post May 18 2017, 09:34 PM
Post#1



Posts: 4,952
Joined: 2-November 04
From: Downey, CA


The following vbscript opens Facebook, Google and Yahoo:

CODE
set sh1=createObject("Wscript.shell")
sh1.run "https://mg.mail.yahoo.com/neo/launch?.rand=71v8fbgb56rdm#9160695791/"

set sh2=createObject("Wscript.shell")
sh2.run "https://www.facebook.com"

set sh3=createObject("Wscript.shell")
sh3.run "https://www.google.com/"


I want to know how to CLOSE them ?

I have another batch file to open multiple windows explorer sessions, and this is the script to close all sessions:

CODE
cmd /c "taskkill /f /im explorer.exe && start explorer"


what would be the corresponding code to close my open facebook, google and yahoo sessions ?
Go to the top of the page
 
theDBguy
post May 18 2017, 09:56 PM
Post#2


Access Wiki and Forums Moderator
Posts: 71,225
Joined: 19-June 07
From: SunnySandyEggo


The only way I can think of right now is by using Windows API to get the Windows Title?

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Microsoft Access MVP | Access Website | Access Blog | Email
Go to the top of the page
 
kfield7
post May 18 2017, 10:09 PM
Post#3



Posts: 774
Joined: 12-November 03
From: Iowa Lot


a shell command...

taskkill /IM chrome.exe /F
taskkill /IM iexplore.exe /F

my bad, somehow I didn't see the end of your post.

Aren't facebook google and yahoo all web sessions? they would close with the taskkill commands.
Go to the top of the page
 
bakersburg9
post May 19 2017, 10:27 AM
Post#4



Posts: 4,952
Joined: 2-November 04
From: Downey, CA


QUOTE
Aren't facebook google and yahoo all web sessions? they would close with the taskkill commands.


Holy [censored]. I think I've been calling this (see image) "Windows Explorer" all these years - what is it called ? wary.gif
Attached File(s)
Attached File  files.png ( 88.42K )Number of downloads: 3
 
Go to the top of the page
 
bakersburg9
post May 19 2017, 11:37 AM
Post#5



Posts: 4,952
Joined: 2-November 04
From: Downey, CA


Ooops - it is windows explorer *Phew* IE - Internet Explorer - I panicked, because I worked with a reports developer one time, and I was telling him how I wrote scripts to open several sessions of Windows Explorer (which he was doing manually, multiple times a day), and he didn't know what Window's Explorer was :-(
Go to the top of the page
 
kfield7
post May 19 2017, 12:16 PM
Post#6



Posts: 774
Joined: 12-November 03
From: Iowa Lot


A lot of folks confuse "windows explorer" and "internet explorer". Many are just not used to look for files using a "file manager" (what "windows explorer" used to be called), but only open files through the application they are working with.

Windows explorer = explorer.exe = file management tool
Internet explorer = iexplore.exe = web browser.
Go to the top of the page
 
bakersburg9
post May 19 2017, 12:30 PM
Post#7



Posts: 4,952
Joined: 2-November 04
From: Downey, CA


GREAT answer! Thanks ! Yeah, in the future, I'm going to slip in "file manager" or "a file manager" when talking about Windows explorer - I personally think file manager is a better name, because that's more descriptive of what it is/does

Thanks ! cool.gif

p.s., as for closing all sessions, a person could press ALT+F4, but I wanted to close only the windows I opened, and do it in code.
Go to the top of the page
 
bakersburg9
post May 19 2017, 03:16 PM
Post#8



Posts: 4,952
Joined: 2-November 04
From: Downey, CA


I just hovered my mouse pointer over the task bar at the extreme bottom of my screen, and a label popped up: "File Explorer"
Attached File(s)
Attached File  FileExplorer.png ( 4.54K )Number of downloads: 0
 
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    13th December 2017 - 05:20 PM