2013-08-27 59 views
0

我試圖創建一種永久性菜單,放置在我的WinPE映像的頂部,該映像提供了:關閉電源,重新啓動和控制檯訪問 - 按該順序。3個圖像按鈕中,只有2個工作

我已經嘗試切換順序,切換名稱,切換圖像,更改關聯,我做的任何事情都會一次完成兩個以上的工作。無論是電源和管理員工作,並重新啓動不,或重新啓動和電源工作和管理不,或管理和重新啓動工作,電源沒有。

您可以擁有的圖像輸入量有限制嗎?

<SCRIPT LANGUAGE="VBScript"> 

    ' Resize and center the window 
    ' ========================================================== 
     sub DoResize 
      window.resizeTo 175,75 
      screenWidth = Document.ParentWindow.Screen.AvailWidth 
      screenHeight = Document.ParentWindow.Screen.AvailHeight 
      posLeft = (screenWidth - 100)/2 
      posTop = (screenHeight - 100)/2  
      window.moveTo posLeft, posTop 
     end Sub 

     DoResize() 
    ' ========================================================== 

</SCRIPT> 

<HEAD> 
    <TITLE> </TITLE> 
    <HTA:APPLICATION ID="oMyApp" 
    APPLICATIONNAME="Options" 
    INNERBORDER="no" 
    BORDER="none" 
    CAPTION="no" 
    SCROLL="NO" 
    SHOWINTASKBAR="NO" 
    SINGLEINSTANCE="yes" 
    SYSMENU="NO" 
    WINDOWSTATE="normal"> 
</HEAD> 
<BODY> 
<body background="Options.png"> 
<SCRIPT LANGUAGE="VBScript"> 

Option Explicit 

Sub Power 

    Dim objShell 
    Dim ret 

    Set objShell = CreateObject("Wscript.Shell") 

    ret = MsgBox("Shut Down Computer?", vbYesNo, "Power Off") 

    If ret = 6 Then 
     objShell.Run "x:\windows\system32\cmd.exe /c wpeutil shutdown", 0, True 
    ElseIf ret = 7 Then 
     Exit Sub 
    End If 

End Sub 

Sub Reboot 

    Dim objShell 
    Dim ret 

    Set objShell = CreateObject("Wscript.Shell") 

    ret = MsgBox("Restart Computer?", vbYesNo, "Restart") 

    If ret = 6 Then 
     objShell.Run "x:\windows\system32\cmd.exe /c wpeutil reboot", 0, True 
    ElseIf ret = 7 Then 
     Exit Sub 
    End If 

End Sub 

Sub Admin 

    Dim objShell 
    Dim ret 

    Set objShell = CreateObject("Wscript.Shell") 

    ret = InputBox("Enter Admin Password", "Password Required") 

    If ret = "password" Then 
     objShell.Run "x:\windows\system32\cmd.exe /k" 
    ElseIf Not ret = "password" Then 
     MsgBox "Incorrect Password", vbOKOnly, "Access Denied" 
    End If 

End Sub 

</SCRIPT> 
<input type="image" img src="power.png" name="power" size="48" onclick="Power"> 
<input type="image" img src="restart.png" name="reboot" size="48" onclick"Reboot"> 
<input type="image" img src="config.png" name="config" size="48" onclick="Admin"> 
</BODY> 
+0

哇哦,有時候真的僅僅是讓你最愚蠢的錯誤。感謝您發現,我可能不會有哈哈。如果你將它作爲答案發布,我會把它發佈。 – AbaddonVH

回答

0

有第二<input>標籤語法錯誤。更換

<input type="image" ... onclick"Reboot"> 

<input type="image" ... onclick="Reboot">