Opening web page using dos
Moderator: DosItHelp
Opening web page using dos
Hi ,
I am very new to dos programming . At specific time , I want to open three specific web pages using scheduler task in windows. Here is the program which is working correctly on double click of batch file , but when it is called by scheduler , it opens only "http://www.dostips.com" page. Can anyone please tell me what i have missed here.
@echo off
SET /P ANSWER=Do u wanna continue (Y/N)?
if /i {%ANSWER%}=={y} (goto :yes)
if /i {%ANSWER%}=={yes} (goto :yes)
goto :no
:yes
start /m -new iexplore url2
start /d iexplore url1
start /d iexplore http://www.dostips.com/
exit /b 0
Thanks
Raje
I am very new to dos programming . At specific time , I want to open three specific web pages using scheduler task in windows. Here is the program which is working correctly on double click of batch file , but when it is called by scheduler , it opens only "http://www.dostips.com" page. Can anyone please tell me what i have missed here.
@echo off
SET /P ANSWER=Do u wanna continue (Y/N)?
if /i {%ANSWER%}=={y} (goto :yes)
if /i {%ANSWER%}=={yes} (goto :yes)
goto :no
:yes
start /m -new iexplore url2
start /d iexplore url1
start /d iexplore http://www.dostips.com/
exit /b 0
Thanks
Raje
Re: Opening web page using dos
try this, it should work
replace "URL_x" with your url
Code: Select all
@echo off
SET /P ANSWER=Do u wanna continue (Y/N)?
if /i {%ANSWER%}=={y} (goto :yes)
if /i {%ANSWER%}=={yes} (goto :yes)
goto :no
:yes
start "" "URL_1"
start "" "URL_2"
start "" "URL_3"
exit /b
replace "URL_x" with your url
Re: Opening web page using dos
Hi ,
I tried the same , but still it is opening only the 3rd url and the first and second .
I tried the same , but still it is opening only the 3rd url and the first and second .
Re: Opening web page using dos
I tried the same , but still it is opening only the 3rd url and the first and second .
ok, then what is the problem
Re: Opening web page using dos
i think the problem is three web pages are opening in same page . So , Initially url1 opens then it gets overwrite by url2 and then by third link. Can it is possible to say open in different tabs?
Re: Opening web page using dos
so you want all three url open in One window but different tabs
if so, just give me some time
if so, just give me some time
Re: Opening web page using dos
According to the 3rd answer here:
so modify the Internet explorer settings,
from tools - internet settings in general tab find tabs and select settings
then in when a pop-up is encountered select Always open pop-up in anew tab
and for firefox you can see This
For me it worked as below:Code: Select all
@echo off
start /d "" IEXPLORE.EXE www.google.com
start /d "" IEXPLORE.EXE www.yahoo.com
With the settings in Internet Explorer 8:
always open popups in a new tab
a new tab in the current window
so modify the Internet explorer settings,
from tools - internet settings in general tab find tabs and select settings
then in when a pop-up is encountered select Always open pop-up in anew tab
and for firefox you can see This
Re: Opening web page using dos
I am using IE 8 with same options enabled . But still the links are opens in separate windows.
Re: Opening web page using dos
IE 9 doesn't open them in tabs either. I fiddled with the tab settings but nothing changed the behaviour of opening in two windows.
Re: Opening web page using dos
This works here:
Code: Select all
@echo off
set file="%temp%\openIE.vbs"
>%file% echo on error resume next
>>%file% echo navOpenInBackgroundTab = ^&h1000
>>%file% echo set oIE = CreateObject("InternetExplorer.Application")
>>%file% echo Set args = WScript.Arguments
>>%file% echo oIE.Navigate2 args.Item(0)
>>%file% echo for inx = 1 to args.count
>>%file% echo oIE.Navigate2 args.Item(inx),navOpenInBackgroundTab
>>%file% echo next
>>%file% echo oIE.Visible = true
cscript /nologo %file% www.google.com www.yahoo.com
del %file% 2>nul
Re: Opening web page using dos
The -new switch is for new instance of IE not a new tab.
So this will open up two instances of IE.
start iexplore.exe -new http://yahoo.com
start iexplore.exe -new http://google.com
So this will open up two instances of IE.
start iexplore.exe -new http://yahoo.com
start iexplore.exe -new http://google.com
Re: Opening web page using dos
@Foxidrive
Your batch work perfect, and if it could wait a few seconds before opening the next website, it will prevent any hanging
Your batch work perfect, and if it could wait a few seconds before opening the next website, it will prevent any hanging
Re: Opening web page using dos
This includes a 3 second delay between pages.
Code: Select all
@echo off
set file="%temp%\openIE.vbs"
>%file% echo on error resume next
>>%file% echo navOpenInBackgroundTab = ^&h1000
>>%file% echo set oIE = CreateObject("InternetExplorer.Application")
>>%file% echo Set args = WScript.Arguments
>>%file% echo oIE.Navigate2 args.Item(0)
>>%file% echo for inx = 1 to args.count
>>%file% echo oIE.Navigate2 args.Item(inx),navOpenInBackgroundTab
>>%file% echo WScript.Sleep 3000 ' The 3000 = 3 seconds
>>%file% echo next
>>%file% echo oIE.Visible = true
cscript /nologo %file% www.google.com www.yahoo.com
del %file% 2>nul
Re: Opening web page using dos
@Foxidrive,
Perfect ,thanks
Perfect ,thanks
-
- Posts: 233
- Joined: 21 Nov 2010 08:07
- Location: At My Computer
Re: Opening web page using dos
You did not say what OS you were using but here's how I do it with Windows 7 and using Firefox..
Run Schtasks first from batch to setup, my example runs daily with start date and set to military time.
Then put your batch in root of c: drive, my example is Web.Pages.cmd.
That't it..
Run Schtasks first from batch to setup, my example runs daily with start date and set to military time.
Then put your batch in root of c: drive, my example is Web.Pages.cmd.
That't it..
Code: Select all
@echo off
::Schtask.cmd
schtasks /create /tn "My.Web.Pages" /tr "\"c:\Web.Pages.cmd\" arguments" /sc daily /sd 09/29/2012 /st 16:30
echo.
echo * DONE *
pause
exit
Code: Select all
@echo off
::Web.Pages.cmd
SETLOCAL ENABLEEXTENSIONS
::Variables
set browser=firefox.exe
set wait_time=2
:: 1. Open multiple tabs for firefox.
START %browser% -new-tab "mail.yahoo.com"
@ping 127.0.0.1 -n %WAIT_TIME% -w 1000 > nul
start "" %browser% -new-tab "support.microsoft.com/fixit/en-us"
start "" %browser% -new-tab "visualbasicscript.com"
start "" %browser% -new-tab "giveawayoftheday.com"
start "" %browser% -new-tab "dostips.com"
:: 2. Permanently set Urls in user profile for firefox.
pushd "%userprofile%\Application Data\Mozilla\Firefox\Profiles"
for /f "delims=" %%a in ('dir /b /ad') do (
echo user_pref^("browser.startup.homepage", "http://www.google.com/|http://www.bing.com/|http://www.dostips.com"^);>>"%%a\user.js"
)
popd
:: 3. Another Way
start "" firefox.exe www.google.com www.bing.com www.dostips.com
exit