473,386 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Windows batch file to open webpage in IE and run javascript

464 Expert 256MB
Hey all, I'm trying to create a simple (I think it should be simple) batch file. I want this file to open Internet Explorer 6 go to the webpage SIRIUS Satellite Radio - The Best Radio On Radio and run the javascript: launchPlayer(",",","); Is this possible? I don't know anything about batch files and i only got to the point where i can open the webpage, but i am unable to open it in IE.

I tried

START "C:\Program Files\Internet Explorer\IEXPLORE.EXE" "www.sirius.com"

but this line opens up the webpage in firefox(my default browser).
How do i get internet explorer to open this web page when its not my default browser?
How do i run the javascript: launchPlayer(",",","); ?

any help would be appreciated.
Dec 3 '08 #1
6 34339
Nepomuk
3,112 Expert 2GB
I don't know about the "starting with IE" part, but instead of opening that JS, why don't you just go to this page?

Greetings,
Nepomuk
Dec 3 '08 #2
anijos
52
Hi,


If IE is your default browser create the bat file as:

Expand|Select|Wrap|Line Numbers
  1. start http://www.sirius.com
if not(in ur case):

Expand|Select|Wrap|Line Numbers
  1. start iexplore http://www.sirius.com
AniJos
Dec 3 '08 #3
Studlyami
464 Expert 256MB
Nepomuk thanks for the link! i couldn't find that address so that help solves that initial problem. Also thanks anijos for your reply that line works just fine.
Expand|Select|Wrap|Line Numbers
  1. start iexplore http://www.sirius.com 
Why wouldn't my line not work?
Expand|Select|Wrap|Line Numbers
  1. START "C:\Program Files\Internet Explorer\IEXPLORE.EXE" "www.sirius.com"
After opening this page in IE is there a way to run a javascript command on that page (for future reference)?
Dec 3 '08 #4
AmberJain
884 Expert 512MB
@Studlyami
Well, if the there is only one command line arguments (CLA) and that too a a string to 'start' command, then that string becomes the title of the new instance of cmd that starts. And that is why the code:
Expand|Select|Wrap|Line Numbers
  1. START "C:\Program Files\Internet Explorer\IEXPLORE.EXE" "www.sirius.com"
starts a new instance of cmd.exe with the window title as "C:\Program Files\Internet Explorer\IEXPLORE.EXE". The parameter "www.sirius.com" is not at all looked after by 'start' command.
Still if you would like to start iexplore.exe using the full path to iexplore, then you should instead use:
Expand|Select|Wrap|Line Numbers
  1. START C:\"Program Files"\"Internet Explorer"\IEXPLORE.EXE
This will do what you want. Although in modern windows OSes, DOS (i.e. NT virtual DOS machine or ntvdm.exe) has LFN support with no " " for filenames/folder names which have a whitespace character but some commands such as 'start' etc. still demands user to use " " in case of directory/filenames with a white space in between. For e.g. You can change to directory [Documents and settings] without use of " " i.e.
Expand|Select|Wrap|Line Numbers
  1. cd Documents and settings
but if you want to use the path to [Documents and settings] as a CLA to 'start' command then you should include the string [Documents and settings] between " " i.e.
Expand|Select|Wrap|Line Numbers
  1. start c:\"Documents and settings"\abcde.exe
@Studlyami
I dont have ideas about this....

Hope this helps....
AmbrNewlearner
Dec 4 '08 #5
Studlyami
464 Expert 256MB
Yeah that does help. Thanks a lot for that explanation.
Dec 4 '08 #6
First, you need to go to the browser, press tools, go to internet options, and press the programs tab. You will see the Set Default Browser.
Nov 9 '11 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: DBA | last post by:
I have a windows batch file that executes a SQL Server bcp command. I would like to obtain a return code if the bcp command fails. However, I cannot seem to find the return code (if any) for bcp....
4
by: Bill | last post by:
I need help closing a CMD window when it is executed from Access. 1) The batch file is called from Access. 2) Access closes, 3) the batch runs a copy of the access database (creating a backup)...
1
by: code_wrong | last post by:
Hi, I'm reading this: http://www.catch22.net/tuts/selfdel.asp (Self Deleting Executables) and playing around with the batch file method .. trouble is I always get a command box at the end with...
4
by: CliffKing | last post by:
I am trying to use Windows Task Scheduler to run a batch file for an already open MS Access database. Below is the syntax to the batch file: Batch file: DailySalesExport.bat REM This runs the...
3
by: emman_54 | last post by:
Hi every one, I am trying to run a batch file using my asp.net application. I am using the Process class to run the batch file. When I run my web application, In the task manager, i could see...
4
by: Ronald S. Cook | last post by:
Currently (manually), I 1) open a Windows SDK Command Prompt and 2) navigate to a particular folder. Then I 3) type a command and press enter. The command is irrelevant (WCF-related) but here it...
1
benchpolo
by: benchpolo | last post by:
I'm not sure if this is the right section to post my question regarding FTP Batch scripting. Question? I have multiple textfiles where the filename is dynamically changing daily. For example, ...
6
by: idealfellow | last post by:
Hi All, Is there anyway i can call windows Batch file from ruby program. I tried the following line, it failed : cmd.exe /c C:\Documents and Settings\user\Desktop\RUN.bat Suggest me...
1
by: John Connor | last post by:
I am attempting to quickly download nearly 1000 .pdf files from a website. Each .pdf has a unique url, and they run in sequence from 1-1000. I would like help writing a batch file that I could run...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.