Using "Run as..." on HTML application

Discussion in 'Scripting' started by David Tilman, Apr 26, 2005.

  1. David Tilman

    David Tilman Guest

    I was wondering how I could use the "Run As..." function with HTML
    applications like I do with executables in Windows XP. When right-clicking on
    the HTA file there is no "Run As..." option.

    For vbs files I just created a shortcut to the vbs file and the "Run As..."
    option will appear for the shortcut. Creating a shortcut directly to the hta
    file doesn't allow this. When I edited the shortcut target properties to:
    "C:\Program Files\Internet Explorer\IEXPLORE.EXE" "H:\Scripts\Test
    Scripts\test.hta" I can double click the shortcut to run the HTML
    application, but choosing "Run As..." from the context menu gives me a "The
    directory name is invalid" error. Is there another approach to this?
     
    David Tilman, Apr 26, 2005
    #1
    1. Advertisements


  2. Make the shortcut execute mshta.exe with the full qouted path to the *.hta
    as the argument...

    if you are creating the shortcut via scripted CreateShortcut, you assign the
    executable (targetpath property) separate from the arguments (arguments
    property)...
     
    Michael Harris \(MVP\), Apr 26, 2005
    #2
    1. Advertisements

  3. Also, make sure that the alternate credentials you are using have full
    access to the hta file.

    Coincidentally, I have just finished an HTA that is started by a batch file
    with runas. The HTA is then used to launch administrative tools without
    having to user runas.

    One thing that threw me was when I tried to do my testing with the
    application in a share rather than on a local drive. Even though the
    alternate account had full administrative access to the share, it somehow
    bombed out.

    /Al
     
    Al Dunbar [MS-MVP], Apr 26, 2005
    #3
  4. David Tilman

    WM Guest

    Not really an answer to your question, but... the host for HTA files
    is MSHTA.exe, not Internet Explorer...
    4/25/2005 8:16:09 PM
     
    WM, Apr 26, 2005
    #4
  5. David Tilman

    Xephyr

    Joined:
    May 23, 2011
    Messages:
    1
    Likes Received:
    0
    Location:
    Oregon
    Thanks ~ it is now behaving

    Ok, thanks much all.
    The Shortcut with target to Mshta worked great.

    C:\WINDOWS\system32\mshta.exe "C:\WINDOWS\system32\R.hta"
    ....perfect. I can now R-Click and use Runas for my alt AD account.
     

    Attached Files:

    • SCCM.JPG
      SCCM.JPG
      File size:
      11.2 KB
      Views:
      1,476
    Xephyr, May 23, 2011
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.