Batch file open url in pre-existing window - batch-file

#echo off
start iexplore http://path/generateInfo.php?orderNum=%1
This is my extremely basic batch file. The issue is that it can be ran 20 different times on one button click, and I want it to create 20 tabs in IE. This currently creates 20 different IE windows. Any help would be great.
Each run would have a different parameter for my php page.

If you try to set the IE browser as a default browser then with the use of the following code you can open the tab in the existing instance of the IE browser.
#echo off
start /d "" www.microsoft.com
Output:

Related

How to run an internet browser in the background without window?

How can I run an internet browser with an url, any url I want, and it opens but it opens in background without showing a window?
It should be like a background media player. And if you know how to do that please tell me and tell me how I can mute the browser once starting. I am trying to do this with a batch file.
You can open a hidden window with powershell. You can use powershell commands within cmd or in a .bat file as well. Here's an example:
powershell saps 'https://stackoverflow.com/questions/44642194' -wi hidden
That opens a hidden window of your default browser with the specified link.

check for and close firefox popup with batch file?

I have this simple batch script that opens up a firefox profile
#echo off
start firefox.exe -P default -no-remote
sometimes the profile is already opened and i get this popup.
Is there anyway to check if the popup appeared and click the close firefox button? Or maybe theres a piece of code where i can close the firefox profile and play that in the begining of the batch file so that i know for sure its closed and dont get that popup. Thanks for your help.
Try with sendkeys.bat:
call sendkeys.bat "Close Firefox" "{LEFT}{ENTER}"

(batch file) open/close tab in already open browser

Is there a possibility to just open and close one single tab in a already running chrome browser session? I dont want to start a whole new browser like the command
start chrome.exe http://stackoverflow.com/
does it. Does someone have an idea how i could realize this?
I now found a way for opening a new tab on a already running browser:
start "webpage name" "http://stackoverflow.com/"
But I still don't know what the command for closing a single tab in a browser is.
Open Tab:
start "www.Discord.com"
or
start "https://Discord.com"
I still dont have any type of command that closes a tab on browser...

Unclosable webpage .bat file

I want to be able to make a .bat or .vbs file that opens a certain website and closes it after a set period of time. I'm trying to get the website to be unclosable until it's manually closed (through task manager) or after a timer of like a minute. Thanks.
You have to open a website in a browsers so you gab to call your browser with a command line argument (in this case the url of the website)
I only know how to do that with Firefox but it should be the same with chrome or IE.
start "" "path to browser" [url or other argument]
^ Title of your window!
Since it's a browser you can only close it manually!

How to refresh IE from command line?

We have five tv's in our office displaying a local web page written in .net. This web page can be updated by three managers at any time of the day to tell staff about events.
the problem is the page doesn't refresh - i can go in remotely and hit f5 which wouldn't be a big deal but the page is updated about 4 to 6 times an hour.
what i really want is either a command line script or batch file that refreshes ie and sits on the pc that displays the web page - then i can add a shortcut to it on the managers computers and after they've updated they can click on that.
Is there either a command line to refresh ie or a batch file? or even a command line that fires f5 as a keypress?
How about building in a Refresh to the webpage if it's under your control? E.g. Every minute with
<meta http-equiv="refresh" content="60">
Yep, I'd definitely go autoit:
#include <IE.au3>
while (true)
$oIE = _IEAttach("sample.html", "URL")
_IEAction($oIE, "refresh")
Sleep(60 * 1000) ;sleep for an hour
WEnd
You can compile the script to a standalone exe too

Resources