| |
samash
Posts: 3
Score: 0
Joined: 10/8/2008
Status: offline
|
Hi. I cant seem to figure out what i am missing in my script (hta). I am asking users to input two fields and then slect from a dropdown on the third field. I have one paramater set as a constant so that is fine. I am able to pass the costant variable, the dropdown variable but not the two user inputs. the variables are showing up as blanks so they are skipped. I tried to echo out the parameters so i could see what happens and get the first parameter as variable, 2nd ends up grabbing what should be the forth variable as the other two are blank. Items in red below are comments about what i see happening and not part of script. Any help would be very much appreciated. <html> <head> <title>.::HP Enclosure Scan Tool::.</title> <HTA:APPLICATION ID="HP Enclosure Scan Tool" APPLICATIONNAME="HP Enclosure Scan Tool" SCROLL="No" SINGLEINSTANCE="yes" WINDOWSTATE="maximize" </head> <SCRIPT Language="VBScript"> Dim strServer Dim Srvcmmd Dim Srvpwd ' declare constant Const srvUser = "administrator" ' Clear all variables srvOA = "" srvpwd = "" Sub Window_Onload self.Focus() self.ResizeTo 700,500 self.MoveTo 200,100 End sub Sub ServerSelectList Set strServer = ServerSelection.Value <- this variable is not getting info from input box below End sub Sub PwdSelectList set srvpwd = (PwdSelection.Value) <- this variable is not getting info from password box below End sub Sub RunScript Srvcmmd = DropDown.Value End Sub Sub RunButton set wshell = CreateObject("WScript.Shell") wshell.run "C:\temp\oa-ps\test\Plink.bat " & srvUser & " "& strServer & " "& srvpwd & " " & Chr(34) & Srvcmmd & Chr(34) set wshell = nothing end Sub </SCRIPT> <style> body { background-color: buttonface; font-family: Helvetica; font-size: 12pt; margin-top: 2px; margin-left: 8px; margin-right: 3px; margin-bottom: 3px; } </style> <body STYLE=" filterrogidXImageTransform.Microsoft.Gradient (GradientType=1, StartColorStr='#CCCCCC', EndColorStr='#FFFFFF')"> <H2 align="center">HP Enclosure Scan Tool</H2> <table border="0" cellpadding="0" cellspacing="0" style="width: 565px; height: 104px"> <tr> <td valign="top" style="height: 30px"> Input Enclosure:</td> <td valign="top" style="height: 30px"> Admin Password:</td> <td valign="top" style="height: 30px"> Select Command to Run:</td> </tr> <tr> <td valign="top" style="width: 284px; height: 15px;"> <input type="text" id="ServerSelection" name="ServerSelectList" size="15" /> </td> <td valign="top" style="width: 284px; height: 15px;"> <input type="text" id="PwdSelection" name="PwdSelectList" size="15" /> </td> <td valign="top" style="width: 289px"> <select size="1" name="DropDown" onChange="RunScript"> <option value="0"></option> <option value= "show rack name"> show rack name </option> <option value= "show enclosure info"> show enclosure info </option> <option value= "show oa status"> show oa status </option> <option value= "show power"> show power </option> <option value= "show interconnect port map all"> show interconnect port map all </option> <option value= "show server info all"> show server info all </option> <option value= "show enclosure temp"> show enclosure temp </option> <option value= "show server temp all"> show server temp all </option> </select></td> <td valign="top" style="width: 284px"> </tr> </table> <input id=runbutton class="button" type="button" value="Run Button" name="run_button" onClick="Runbutton"> </body> </html>. Below is output i have echoing from script so i can see what it is passing C:\temp\oa-ps\test>echo administrator administrator C:\temp\oa-ps\test>echo "show power" <----- this one should be the 4th parameter "show power" C:\temp\oa-ps\test>echo <----- ECHO is on. C:\temp\oa-ps\test>echo ECHO is on. C:\temp\oa-ps\test>plink administrator@"show power" -ssh -pw 1>output.txt plink: option "-pw" requires an argument
|
|