Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > Using "Run as..." on HTML application

Reply
Thread Tools Display Modes

Using "Run as..." on HTML application

 
 
David Tilman
Guest
Posts: n/a

 
      04-26-2005
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?
 
Reply With Quote
 
 
 
 
Michael Harris \(MVP\)
Guest
Posts: n/a

 
      04-26-2005
David Tilman wrote:
> 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?



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
Microsoft MVP Scripting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Please ask follow-up questions via the original newsgroup thread.



 
Reply With Quote
 
Al Dunbar [MS-MVP]
Guest
Posts: n/a

 
      04-26-2005

"Michael Harris (MVP)" <mikhar at mvps dot org> wrote in message
news:%...
> David Tilman wrote:
> > 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?

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


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


 
Reply With Quote
 
WM
Guest
Posts: n/a

 
      04-26-2005
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
David Tilman <> wrote in message
<B8A17CB5-DE96-4686-A693->

> 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?

 
Reply With Quote
 
Junior Member
Join Date: May 2011
Location: Oregon
Posts: 1

 
      05-23-2011
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 Images
 
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application abending with exception codes "0xc0000005" or "0xc0000374" Howard Woodard Windows 64 Bit 2 12-18-2011 07:37 PM
"This file is in use by another application or user" and "Application Data" folder Colin A Windows Small Business Server 3 01-24-2009 11:41 PM
What to do to access "Local Settings" and "Application Data"? Michael Moser Windows Vista Administration 1 12-02-2007 07:31 PM
"File Type" "HTML" missing cajun_mike Windows Media Center 0 08-07-2007 03:24 PM
HTML Target="_blank" does not work with "new" Google task bar Chris_from_Hertfordshire Internet Explorer 0 09-04-2006 09:46 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59