Welcome to WebmasterWorld Guest from 54.224.13.210

Forum Moderators: phranque

Message Too Old, No Replies

Loading an html file into IE from the dos command line

using a script

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 8, 2003
posts:659
votes: 0


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?

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

Senior Member

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

joined:Mar 2, 2003
posts:3710
votes: 0


...... 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.

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 8, 2003
posts:659
votes: 0


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]
12:12 am on Oct 4, 2004 (gmt 0)

Senior Member

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

joined:Mar 2, 2003
posts:3710
votes: 0


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.

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members