MSFN Forum: HTA-Based Program Menu in WinPE 2.0 - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

HTA-Based Program Menu in WinPE 2.0 Rate Topic: -----

#1 User is offline   bblaze83 

  • Group: Members
  • Posts: 5
  • Joined: 17-July 09

Posted 17 July 2009 - 04:44 PM

I am trying to create a menu with links to programs local on winpe image. I am using a bootable flash drive to get into winpe. I am having trouble with the links actually working. The links work just fine from the HTA in a windows environment, but when in winpe, I get nothing. I can click forever and no joy. Please help.


#2 User is offline   bblaze83 

  • Group: Members
  • Posts: 5
  • Joined: 17-July 09

Posted 17 July 2009 - 08:05 PM

I was able to get the hta menu to start working by using some VBscript. The problem now is that the second and third programs will not run. I am getting an error on line 53 and 61 character 11. I cannot see the problem though as each line was copied from working ones. The script is as follows:

 
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>PE Applications</title>
<script language="vbscript">
<!-- Insert code, subroutines, and functions here -->
Set oShell = CreateObject("Wscript.Shell")
oShell.Run "%Comspec% /c dir",1,True
</script>
<hta:application
applicationname="apps" 
border="dialog"
borderstyle="normal"
caption="Win PE Applications"
contextmenu="no"
icon="myicon.ico"
maximizebutton="no"
minimizebutton="yes"
navigable="no"
scroll="no"
selection="no"
showintaskbar="yes"
singleinstance="yes"
sysmenu="yes"
version="1.0"
windowstate="maximize"
>
</head>
<body bgcolor="#000021" text="#FFFFFF">

<font FACE="Arial" Size=+4>
<center><p>| WinPE Utilities |</p>
</font>
<p>&nbsp</p>
<p>&nbsp</p>
<p>&nbsp</p>
<p>&nbsp</p>
<p>&nbsp</p>
<p>&nbsp</p>
<font face="arial" size=+2>
      <script language="VBScript">
        Sub RunClam
          Dim WshShell
          Set WshShell = CreateObject("WScript.Shell")
          WshShell.Run "x:\tools\clam\clamwinportable.exe", 1, true
        End Sub        
     </Script>  
<p>     <Input type="button" value="Clam AntiVirus" name="RunClam" onclick="RunClam"></p>
[b]      <script language="VBScript">
        Sub RunAvast
          Dim WshShell
          Set WshShell = CreateObject("WScript.Shell")
          WshShell.Run "x:\tools\avast\avast.exe", 1, true
        End Sub        
     </Script>
<p>     <Input type="button" value="Avast AntiVirus" name="RunAvast" onclick="RunAvast"></p>
      <script language="VBScript">
        Sub RunDr
          Dim WshShell
          Set WshShell = CreateObject("WScript.Shell")
          WshShell.Run "x:\tools\drweb\drweb.exe", 1, true
        End Sub
      </Script>
<p>     <Input type="button" value="Dr. Web AntiVirus" name="RunDr" onclick="RunDr"></p>[/b]
      <script language="VBScript">
        Sub RunSophos
          Dim WshShell
          Set WshShell = CreateObject("WScript.Shell")
          WshShell.Run "x:\tools\sophos\sav32cli.exe", 1, true
        End Sub
     </Script>
<p>     <Input type="button" value="Sophos CLI AntiVirus" name="RunSophos" onclick="RunSophos"></p>
      <script language="VBScript">
        Sub RunFC
          Dim WshShell
          Set WshShell = CreateObject("WScript.Shell")
          WshShell.Run "x:\tools\freecommander\freecommander.exe", 1, true
        End Sub
     </Script>
<p>     <Input type="button" value="Free Commander" name="RunFC" onclick="RunFC"></p>
      <script language="VBScript">
        Sub RunRA
          Dim WshShell
          Set WshShell = CreateObject("WScript.Shell")
          WshShell.Run "x:\tools\runalyzer\runalyzer.exe", 1, true
        End Sub
     </Script>
<p>     <Input type="button" value="RunAlyzer" name="RunRA" onclick="RunRA"></p>

</font>
</center>
</body>
</html> 


problem area here:
 
<script language="VBScript">
        Sub RunAvast
          Dim WshShell
          Set WshShell = CreateObject("WScript.Shell")
          WshShell.Run "x:\tools\avast\avast.exe", 1, true
        End Sub        
     </Script>
<p>     <Input type="button" value="Avast AntiVirus" name="RunAvast" onclick="RunAvast"></p>
      <script language="VBScript">
        Sub RunDr
          Dim WshShell
          Set WshShell = CreateObject("WScript.Shell")
          WshShell.Run "x:\tools\drweb\drweb.exe", 1, true
        End Sub
      </Script>
<p>     <Input type="button" value="Dr. Web AntiVirus" name="RunDr" onclick="RunDr"></p> 


The bold areas are where the problem is residing. Any help would be greatly appreciated.

This post has been edited by Tripredacus: 18 July 2009 - 12:02 AM
Reason for edit: codebox


#3 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 6,988
  • Joined: 28-April 06
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 18 July 2009 - 12:03 AM

What is the error you got?

Also, is there a specific reason why you haven't upgraded your PE version?

#4 User is offline   bblaze83 

  • Group: Members
  • Posts: 5
  • Joined: 17-July 09

Posted 18 July 2009 - 12:05 PM

The error that I am getting is "user canceled operation". It is stating that the error is on line 54 and 63, char 11. When I was getting that error I had spaces between each set of scripts. For example:

 
<script language="VBScript">
Sub RunAvast
Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
[color="#FF0000"][b]WshShell.Run "x:\tools\avast\avast.exe", 1, true[/b][/color]
End Sub
</Script>
<p> <Input type="button" value="Avast AntiVirus" name="RunAvast" onclick="RunAvast"></p>

<script language="VBScript">
Sub RunDr
Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
[color="#FF0000"][b]WshShell.Run "x:\tools\drweb\drweb.exe", 1, true[/b][/color]
End Sub
</Script>
<p> <Input type="button" value="Dr. Web AntiVirus" name="RunDr" onclick="RunDr"></p> 


The bold red lines are where the error code was stating. It is char 11 where it said the error was.
It's not the launched program that is causing the problem because it can be launched from the command line just fine. The problem resides on 2 different computers as well.

As for not changing to WinPE 3.0: 1) it's a BETA and I'm not too keen on BETA, I am looking for something stable and tested. 2) That's what I am used to. I like the "way it handles." It's missing some good stuff like easily customizable shells and so forth. That is why I am using an HTA.

#5 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 6,988
  • Joined: 28-April 06
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 18 July 2009 - 02:38 PM

I have a feeling that those programs may require a cmdline parameter to stay open. For example, in this post:
http://www.msfn.org/...howtopic=121316

The user can't launch imagex.exe in a similar fashion, but can launch notepad. Imagex can't be run by simply typing in the name of the app, it needs parameters. However, you can try an alternate method of launching the program to see if that has any result.

In this example, the "1" is actually "1.exe"
http://www.msfn.org/board/index.php?s=&...st&p=870462

I'll give this a little time but I'm probably going to move this into the scripting forum.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy