Run PowerShell Scripts from an HTA Menu

Here is a simple menu to run a dozen different PowerShell Scripts;
Just the thing for people who need to run a bunch of canned scripts on a regular basis.
Copy this and save it as HTA type file. eg. MyMenu.hta  
Be carefull of the line wraps. Everything the between the <BR>’s is one line


‘ VBScript Source File — Created with SAPIEN Technologies PrimalScript 2007

‘ NAME: MyMenu.hta

‘ AUTHOR: OldDog
‘ DATE  : 7/29/2009

‘ COMMENT: Use Short Path Names!!!!!! You find them by doing a DIR /x

<script LANGUAGE="vbscript">
Sub Window_Onload
 self.ResizeTo 900,700
End Sub
Sub runhta(htaSrc)
 Dim WshSHell
 set WshShell = CreateObject("WScript.Shell")
End Sub
<BODY STYLE="font:14 pt arial; color:white;
(GradientType=1, StartColorStr=’#000000′, EndColorStr=’#0000FF’)">
<CENTER><H2>My Menu</H2></CENTER>
<LI><a href="#" onClick="runhta(‘powershell -noexit C:PROGRA~1PhoneH~1FCTopology Locater.ps1’)">FCTopology Locater</a>
<LI><a href="#" onClick="runhta(‘powershell -noexit C:PROGRA~1PhoneH~1FC_4Gb_Drive_check.ps1’)">FC_4Gb_Drive_check</a>
<LI><a href="#" onClick="runhta(‘powershell -noexit C:PROGRA~1PhoneH~1Remote_Ports_check.ps1’)">Remote_Ports_che­ck</a>
<LI><a href="#" onClick="runhta(‘powershell -noexit C:PROGRA~1PhoneH~1Connection_Counter_check.ps1’)">Connection_Counter_check</a>
<LI><a href="#" onClick="runhta(‘powershell -noexit C:PROGRA~1PhoneH~1SubSystem_Table.ps1’)">SubSystem_Table</a>
<LI><a href="#" onClick="runhta(‘powershell -noexit C:PROGRA~1PhoneH~1Soft_Reset_check.ps1’)">Total_Soft_Reset_check</a>
<LI><a href="#" onClick="runhta(‘powershell -noexit C:PROGRA~1PhoneH~1Rogue_Events.ps1’)">Rogue_Events</a>
<LI><a href="#" onClick="runhta(‘powershell -noexit C:PROGRA~1PhoneH~1Maximum-Values.ps1’)">Maximum-Values</a>
<LI><a href="#" onClick="runhta(‘powershell -noexit C:PROGRA~1PhoneH~1Maxtor_Drives_Search.ps1’)">Maxtor_Drives_Search</a>
<LI><a href="#" onClick="runhta(‘powershell -noexit C:PROGRA~1PhoneH~1QLA4010 HBA_Locator.ps1’)">QLA4010 HBA_Locator</a>
<LI><a href="#" onClick="runhta(‘powershell -noexit C:PROGRA~1PhoneH~1Raid_Device_and_Extent_Counter.ps1’)">Raid_Device_and_Extent_Counter</a>
<LI><a href="#" onClick="runhta(‘powershell -noexit C:PROGRA~1PhoneH~1Search_for_SATA_revisions.ps1’)">Search_for_SATA_revisions</a>
<LI><a href="#" onClick="runhta(‘powershell -noexit C:PROGRA~1PhoneH~1System_Upgrade_Dates.ps1’)">System_Upgrade_Dates.ps1</a>
<CENTER><BUTTON onclick="self.close()">Exit</BUTTON></CENTER>

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s