Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTA Run Script Error in WIndows PE 2.0

Status
Not open for further replies.

DaveNamou

IS-IT--Management
Feb 7, 2002
175
US
Hi,
I've created the simple code below for an HTA application which has a button to launch Notepad.

The script works fine on Windows 2003 and Windows XP.

My problem is when I try to use the script on Windows PE 2.0.
- The HTA application loads fine but when I click the button to launch Notepad I get the error below.
The error is actually blank without any data in it and I cannot close the error or the HTA app without use "Taskkill" to end the entire HTA application.

NOTE: I have added the HTA, WMI and Scripting packages in the Windows PE Build.

Anyone have any idea what is wrong?
Thanks in advance for any help on this.

Code:
[Internet Explorer Script Error]
An Error has occured in the script on this page.
Line:
Char:
Code:
URL:
Do you want to continue running scripts on this page?
[yes] [no]

Script Code for test.hta
Code:
<HTML>
  <HEAD>
    <TITLE>Menu</TITLE>
      <HTA:APPLICATION
        ID = "MyMenu"
        APPLICATIONNAME = "Menu"
        >
      <Script language="VBScript">
        Sub RunCmd
          Dim WshShell
          Set WshShell = CreateObject("WScript.Shell")
          WshShell.Run "Notepad.exe", 1, true
        End Sub
      </Script>
  </HEAD>

  <BODY>

    <Input type="button" value="Run CMD" name="RunCMD" onclick="RunCMD">

  </BODY>
</HTML>

Dave Namou, MCSE CCEA
 
Might be worth posting a link to this on the Vista forum. Windows PE isn't one of the mainstream Windows OSs that most people use. It is normally the sysadmin types who play with it and even though it was available on XP, not many people used it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top