+ Reply to Thread
Results 1 to 6 of 6

Thread: opening .hta from .hta

  1. #1
    Barn Regular grnzbra is an unknown quantity at this point grnzbra's Avatar
    Join Date
    May 2009
    Posts
    66
    Rep Power
    3

    opening .hta from .hta

    I have an hta vbScript file which opens a second .hta file with the lines:

    flnm = "Test.hta"
    flnm = "c:/HTAFiles/" & flnm
    open flnm

    When this is run, the first thing it does is open Internet Explorer which then asks if I want to run it or save it. Is there any way to open this without it trying to open IE first? Both files reside on the local machine, although the second file runs a SQL query against the msdb database in SQL Server.

  2. #2
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    Welcome to DeveloperBarn

    Have you tried something like this?
    Code:
        Set objShell = CreateObject("Wscript.Shell")
        objShell.Run flnm
    
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  3. #3
    Barn Regular grnzbra is an unknown quantity at this point grnzbra's Avatar
    Join Date
    May 2009
    Posts
    66
    Rep Power
    3

    I commented out

    open flnm (which opened the file after going through IE and run/save)

    and added your suggsted lines.

    This generated an "Internet Explorer Script Error" which said:

    "The system cannot find the file specified" and blamed it on the line:

    objShell.Run flnm

    oh, yes. When I enter "file:///c:/..." into the address window if IE, the .hta opens without the run/save message. It also runs from the command line with just "c:/..." and it runs fine on computer startup.
    Last edited by grnzbra; May 21st, 2009 at 10:49 AM. Reason: afterthought

  4. #4
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    Just a thought...if the file you're trying to open is in the same directory as the file you're opening it from, do you even need to specify the complete path? Wouldn't "Test.hta" simply work?
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  5. #5
    Barn Regular grnzbra is an unknown quantity at this point grnzbra's Avatar
    Join Date
    May 2009
    Posts
    66
    Rep Power
    3

    You're right. That worked. But it still opens IE first.

    OOPS! I spoke too soon. I was back to playing with "open..."

    Using the shell script and just the file name, it popped right up.

    THANK YOU!!!
    Last edited by grnzbra; May 21st, 2009 at 11:40 AM.

  6. #6
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    Glad I could help
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


+ Reply to Thread

Similar Threads

  1. opening excel file
    By todd2006 in forum ASP Development
    Replies: 5
    Last Post: April 30th, 2008, 06:36 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO