Problems with ExecuteFile launching a URL in a browser

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
pasdad1
Junior Coder
Posts: 21
Joined: Wed Nov 17, 2004 1:09 am

Problems with ExecuteFile launching a URL in a browser

Post by pasdad1 » Sat Mar 17, 2007 2:49 am

I have used ExecuteFile> many times in the past to open the default browser with a specific URL, however this particular URL
in macroscheduler causes an access violation in shell32.dll. I can paste the URL
directly into the Start -> Run box, and it opens just fine.

I want to use ExecuteFile because it uses whatever browser the user has associated with internet
files. Using Run Program would work, but I would need to know what browser they have.

Here is the sample code: The short URL works fine, the long one doesn't. I suspect it has something to do with the escaped
characters, however the run box doesn't have a problem with it, so it must be something macro scheduler is doing when it makes the call to shell32.dll

Code: Select all


Let>url=http://tess2.uspto.gov/bin/showfield?f=toc&state=hl1urq.1.1&p_search=searchss&p_L=50&BackReference=&p_plural=yes&p_s_PARA1=&p_tagrepl%7E%3A=PARA1%24LD&expr=PARA1+AND+PARA2&p_s_PARA2=DocuTrac&p_tagrepl%7E%3A=PARA2%24COMB&p_op_ALL=ADJ&a_default=search&a_search=Submit+Query
//Let>url=http://www.google.com/search?hl=en&q=sample
Executefile>url

Thanks for any assistance you can give.

User avatar
Captive
Macro Veteran
Posts: 213
Joined: Sun Oct 20, 2002 8:37 pm
Location: Colorado, USA

Post by Captive » Sat Mar 17, 2007 4:27 am

WinXP, MSIE v7, the script you posted seems to work fine - however my msched seemed to crash. (First it just closed, no error, then 2nd attempt I got an access violation.)

Maybe you've found a bug!

An old example worked fine...

Code: Select all


VBSTART

Function OpenPage (URL,Wait)
  Dim IE
  Set IE = CreateObject("InternetExplorer.Application")
  IE.visible = 1
  IE.navigate URL

  do while IE.Busy and Wait
  loop

  OpenPage = IE.LocationURL
End Function

VBEND

Let>url=http://your.long.url.here/
VBEval>OpenPage("%URL%","1"),NewURL
(I change the Let>url=... because it didn't seem happy in my textarea post)

And this also worked...

Code: Select all

Run>"C:\Program Files\Internet Explorer\iexplore.exe" "%URL%"

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Sat Mar 17, 2007 5:09 am

Try this it worked for me whether explorer or firefox was set as default.

Code: Select all

RegistryReadKey>HKEY_LOCAL_MACHINE,SOFTWARE\Classes\HTTP\Shell\Open\command,,value
Separate>value,.EXE,var
Let>url=http://tess2.uspto.gov/bin/showfield?f=toc&state=hl1urq.1.1&p_search=searchss&p_L=50&BackReference=&p_plural=yes&p_s_PARA1=&p_tagrepl%7E%3A=PARA1%24LD&expr=PARA1+AND+PARA2&p_s_PARA2=DocuTrac&p_tagrepl%7E%3A=PARA2%24COMB&p_op_ALL=ADJ&a_default=search&a_search=Submit+Query
Run>"%var_1%.exe" "%URL%"

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