Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

opening a http:// from dos prompt ? 2

Status
Not open for further replies.

ttrinh

MIS
Jan 21, 2002
93
0
0
AU
Hi
Can anyone tell me if its possible to open a browser and run a specific url /file like .asp or .cfm from the dos prompt ? I am new to the command line and have not been able to find anything that suggests that this can be done. Am I looking in the wrong places?

TIA
 
If you copy c:\program files\iexplore.exe to your path (such as C:\Windows or C:\Winnt\System32) you can do it.

Then type:
iexplore
its magic! :) pbxman
Systems Administrator

Please let Tek-Tips members know their posts were helpful.
 
if you right click on "my computer" and go enviroment,put in a new variable which points to the location of iexplore.exe...something like C:\progra~1\plus\micros~1\iexplore.exe and save it.
You can then call the program from anywhere within the OS.
David
 
good addition crwpulsar - i was gonna go there, but he said he's new to the command line..in that case its easier to copy the .exe into the existing environment...it will still run anywhere in the OS, and it's just too easy to mess up on accident :) pbxman
Systems Administrator

Please let Tek-Tips members know their posts were helpful.
 
Ploxman and cwpulsar, yes you are right, that did do the trick ,my appologies. One further question... is it possible to close the browser say a few secs after I have opened it from the dos prompt ?

Thanks again!!
 
Hi,
you can try something as:
C:\>"C:\Program Files\Plus!\Microsoft Internet\IEXPLORE.EXE" "Javascript:Test=wi
ndow.open(' 2000);"

This will open a first window to execute the javascript.
This Javascript will open a new window with the URL you want, then after a time out (2 sec here) will close both the windows.
You can add window.blur(); before the setTimeout function to minimize the first window during the process.

I hope this can help.

Thierry
 
I tried what you suggested ThJ It works great however I want the window to automatically close without any input from anyone. Doing this C:\Program Files\Plus!\Microsoft Internet\IEXPLORE.EXE "Javascript:Test=wi
ndow.open(' 2000);"
prompts me to confirm that I really do want to close the browser. Is it possible to do it automatically ?

thanks
 
I didn't find a way to turn around the alert message.

Sorry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top