homepage Welcome to WebmasterWorld Guest from 54.196.63.93
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / WebmasterWorld / Webmaster General
Forum Library, Charter, Moderators: phranque

Webmaster General Forum

    
Loading an html file into IE from the dos command line
using a script
SlowMove

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 6775 posted 6:59 pm on Oct 3, 2004 (gmt 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?

 

kaled

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



 
Msg#: 6775 posted 7:17 pm on Oct 3, 2004 (gmt 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.

SlowMove

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 6775 posted 8:32 pm on Oct 3, 2004 (gmt 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]

kaled

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



 
Msg#: 6775 posted 12:12 am on Oct 4, 2004 (gmt 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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / Webmaster General
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved