473,790 Members | 3,185 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Windows batch file to open webpage in IE and run javascript

464 Recognized Expert Contributor
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\IEXPLO RE.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 34511
Nepomuk
3,112 Recognized Expert Specialist
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 New Member
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 Recognized Expert Contributor
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 Recognized Expert Contributor
@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\IEXPLO RE.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 Recognized Expert Contributor
Yeah that does help. Thanks a lot for that explanation.
Dec 4 '08 #6
alex51164
1 New Member
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
17741
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. For example, if the bcp command is improperly formatted, or has a bad password, I want the batch file to return an error. Right now, my batch file simply executes and returns success, even when the bcp command fails. Has anyone run into this...
4
47542
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) 4) Once the copy is complete, the batch file opens the Access database again 5) EXIT should close out the cmd window but it does not execute that line
1
4734
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 the "the batch file cannot be found" message .. how can I get rid of this .. while staying with the batch file method? here is my code: /*self deleting exe*/
4
26818
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 macro that exports the reports to the J drive PATH = "C:\Program Files\Microsoft Office\Office\;C:\Windows\Command" START /WAIT Msaccess.exe "D:\acesdata\SALES\Daily2005.mdb" /x "SnapShotExportDailySales" EXIT
3
4473
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 cmd.exe with ASPNET as a user. But nothing happens. It can't execute the batch file. This is the code i am using to run the batch file:
4
4698
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 is FYI: svcutil http://localhost/COWFeedyardService/Services/Pen.svc /out:Pen.vb /config:App.config /language:VB All works fine, but I need to do this over a hundred times changing "Pen" to the names of the other classes and re-executing.
1
3854
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, Member_20071014.txt, Member_20071015.txt, Member_20071016.txt. These files are produced daily, how do I write a batch script that will pick-up the current date text file to upload on an FTP site. I tried to research windows batch file scripting,...
6
21864
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 if you have an answer for this. Cheers
1
3528
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 once and would (in the background) access the .pdf via its url, save a copy, and then move on to the next one. Similar to (this is sloppy C++ and English combined, its been a while since i've used the language and I do not know Batch files at...
0
9512
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10419
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10201
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10147
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9987
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9023
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6770
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5424
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

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.