Welcome to WebmasterWorld Guest from 50.19.53.104

Forum Moderators: phranque

Message Too Old, No Replies

Loading an html file into IE from the dos command line

using a script

     

SlowMove

6:59 pm on Oct 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm running a Perl script (on win32) that uses a system call to open a browser window and load a new html file. So, the script uses the simple DOS command:
[i]C:\"Program Files"\"Internet Explorer"\iexplore.exe C:directory\file.html[/i]

The browser opens fine, but instead of loading C:directory/file.html, the browser tries to open http://files"/"Internet%20Explorer"/iexplore.exe%20C:directory/file.html, which doesn't exist, and I get an error message. Does anyone know what I'm doing wrong?

kaled

7:17 pm on Oct 3, 2004 (gmt 0)

WebmasterWorld Senior Member kaled is a WebmasterWorld Top Contributor of All Time 10+ Year Member



...... C:\directory\file.html might work better (but maybe that was just a typo).

Assuming that IE is the default browser, there should be no need to specify the browser on the command line in DOS. As with opening a .txt file, if notepad is associated with .txt files, it should open.

Also, the filename must be in quotes if it contains spaces.

Also, since this is IE, the filename spec may need / instead of \ if you are specifying the browser explicitly.

Just a few thoughts,

Kaled.

SlowMove

8:32 pm on Oct 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks. Firefox is my default browser, but I'm using IE because the new pages have links that I want to check for page rank. I changed the backslashes to forward slashes as you suggested, and moved the quotes around, and it works now.

This was the old code:

[b]my $current_path = Win32::GetCwd();
$current_path = $current_path . "\\edited\\new\.html";
system ("C:\\\"Program Files\"\\\"Internet Explorer\"\\iexplore\.exe $current_path");[/b]

This is the new code:

[b]my $current_path = Win32::GetCwd();
$current_path =~ s/\\/\//g;
$current_path = $current_path . "\/edited\/new\.html";
system ("\"C:\\Program Files\\Internet Explorer\\iexplore\.exe\" $current_path");[/b]

kaled

12:12 am on Oct 4, 2004 (gmt 0)

WebmasterWorld Senior Member kaled is a WebmasterWorld Top Contributor of All Time 10+ Year Member



There is an (unofficial) extension for firefox to show page rank. Seems to work well, but in the months since it was released, no PR updates seem to have taken place!

Kaled.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month