Limitation of ExecuteFile

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Limitation of ExecuteFile

Post by armsys » Tue Dec 31, 2002 11:27 am

Referring to the following sample script:

Let >HTTPdoc=C:\Documents and Settings\Very Long Name\My Documents\Multi Edit Software, Inc_ - Tech Support.htm
Message>HTTPdoc
Exe>HTTPdoc
Run>C:\Program Files\Internet Explorer\IEXPLORE.EXE %HTTPdoc%


I discover a potential bug of ExecuteFile. For the exactly identical filename, namely, HTTPdoc, IEXPLORER.EXE runs perfectly while ExecuteFile fails becasue somehow it truncates the long file name. The file association with .HTTP is fine; that is, double-clicking any .http files can activate the IE browser. I ran several tests. It has nothing to do with the spaces and/or special non-alphanumeric chars embeded in the filename.

In sum, the length of Filename is definitely the cause for fatal error to the ExecuteFile command.

Your comment will be appreciated. Many thanks in advance.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Dec 31, 2002 3:40 pm

Hi Armstrong....

I get a different conclusion.

I duplicated your exact path and filename. The only difference I am aware of is that my default browser is Netscape 4.79. But I did include Iexplore line from your original script also .

I found that the culprit seems to be the comma after the word Software.

If I change that to an underscore "_", then the page opens as designed. It opened with my default browser, Netscape, and it also opened with MSIE from the Iexplore line.

I then made a copy of that file, named
"Copy of Multi Edit Software_ Inc_ - Tech Support.htm" (without the quotes), and that also ran OK. So it does not appear to be a problem with the overall length, but with the comma in the file name.

The following script runs OK on my system:
====================================
Let >HTTPdoc=C:\Documents and Settings\Very Long Name\My Documents\Copy of Multi Edit Software_ Inc_ - Tech Support.htm

Message>HTTPdoc

Exe>HTTPdoc

Run>C:\Program Files\Internet Explorer\IEXPLORE.EXE %HTTPdoc%

========================
If you are still having the problem, then perhaps the problem may be with Internet Explorer. Or additional tests could be done to see if the position of the comma is the problem.

But I think it is that comma.

Hope this helps, good luck, thanks for your past support.

Happy New Year!





armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Wed Jan 01, 2003 1:04 am

Hi Bob,

1. I'm grateful for your painstaking effort in helping me resolve the technical issue which I spent a whole afternoon yesterday trying to figure it out.

2. Most importantly, I was absolutely wrong in alleging the potential bug (namely, the limitation of length of the filename) of the ExecuteFile. Thanks to your encouraging tip, I tried again with a long file name (without any comma). The ExecuteFile runs perfectly regardless of the length of the filename as long as it doesn't contain any comma. Again, thanks for your help.

3. The filenames embedded with commas ran perfectly with following VBScript code (I borrowed from http://www.mjtnet.com/scripts.hts?display+77):
URL = C:\Documents and Settings\Very Long Name\My Documents\Multi Edit Software, Inc_ - Tech Support.htm
Set IE = CreateObject("InternetExplorer.Application")
IE.visible = 1
IE.navigate URL
Of course, the comma embedded filename ran perfectly with Macro Scheduler's RUn command.

4. I noticed the error message of ExecuteFile command indicated a truncation starting from the comma (,), but never suspected the comma was the actual culprit.

5. In future, when saving webpages, I'll be careful to rename the htm filenames such that commas will be excluded.

6. Though it isn't a major issue, I suppose MJT may look into the comma problem.

Thanks a lot. You're always welcome. Happy New Year!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts