473,325 Members | 2,828 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,325 software developers and data experts.

Running dos commands!

I want to execute a html file named hai.html in c:\mydocuments folder.
How can i open this file in Internet explorer or netscape?
thank you in advance ,
vishnu
Jul 17 '05 #1
2 9607
As to run dos commands you can simply write:

Process p = Runtime.getRuntime().exec("<<command>>");

As to view an html file in IExplorer or Netscape I think you can
just write "filename.html" in the exec String parameter because
the System under the VM automatically find the best program to
execute that file extension. So if IE is the "default browser" IE
will be opened; if Netscape do, Netscape will be opened.
Anyway "nomefile.html" will be shown!

Regards.
Luca Paganelli

"vishnu mahendra" <vi*************@yahoo.com> wrote in message
news:c2*************************@posting.google.co m...
I want to execute a html file named hai.html in c:\mydocuments folder.
How can i open this file in Internet explorer or netscape?
thank you in advance ,
vishnu

Jul 17 '05 #2
On 1/18/04 2:41 AM, in article 0r*******************@tornado.fastwebnet.it,
"Luca Paganelli" <as*@me.it> wrote:
As to run dos commands you can simply write:

Process p = Runtime.getRuntime().exec("<<command>>");


With regards to opening a document on a Windows platform, it is better to
use the "start" command, and pass the html file as an argument. Like:

Process p = Runtime.getRuntime().exec("start myfile.html");

Off hand, I'm not sure if you need to pass the whole path to start or not.
You could probably also use the environment variables in the string, like
%SYSTEM_ROOT%, if I remember correctly.
Anthony

--
Got a blog? Post it:
http://www.martin-studio.com/weblog-index/

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Will Seay | last post by:
At the end of this message I've pasted a script we're trying to modify slightly. I don't believe it is VBscript or javascript but these are the closest groups I could find with my limited...
9
by: Brian Roberts | last post by:
I have a command line Python program that sometimes takes a bit (several minutes) to run. I want to provide an optional method for an impatient user (me!) to check the status of the program. The...
1
by: stealthwang | last post by:
I'm still very new to Python, after decideding to learn a true programming language (rather then a scripting language, i like to think i'm a intermediate PHP user). I decided for my first project I...
8
by: Paul Cochrane | last post by:
Hi all, I've got an application that I'm writing that autogenerates python code which I then execute with exec(). I know that this is not the best way to run things, and I'm not 100% sure as to...
9
by: kapsi | last post by:
Hey all, I was just wondering as to how to implement dos commands and windows commands using the C language? any ideas?
0
by: Mr Bounce | last post by:
Hi, Probably well worn ground, this, but im stumped and need some help, if you could: I'm trying to write some code for a windows service that needs to run in the background polling a server...
2
by: Franck Diastein | last post by:
Hi, I'm designing an application, and I would like to be able to receive external commands... I would like a behavior like eMule, when you click on an ed2k link, the link is added to eMule, even...
14
by: miago | last post by:
Searching this forum I found an example of running Unix commands from Python;I wonder if there is a way to get the output of windows commands on a string using Python.Thanks in advance; Miago.
6
by: Mike | last post by:
I'm having trouble running TSQL commands when SQL2005 is in single- user mode. I've restarted SQL with -m, -c, -T3608 set in the startup options. I can get into Config manager OK, but as soon...
4
by: SPJ | last post by:
Is it possible to run specific commands on cisco router using Python? I have to run command "show access-list" on few hundred cisco routers and get the dump into a file. Please let me know if it is...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.