0
password = "12345678"   
strComputer = "."  
strExe = "taskkill /F /IM explorer.exe"  
' Connect to WMI  
set objWMIService = getobject("winmgmts://"_  
& strComputer & "/root/cimv2")




' Obtain the Win32_Process class of object.  
Set objProcess = objWMIService.Get("Win32_Process")  
Set objProgram = objProcess.Methods_( _  
"Create").InParameters.SpawnInstance_  
objProgram.CommandLine = strExe  

'Execute the program now at the command line.  
Set strShell = objWMIService.ExecMethod( _  
"Win32_Process", "Create", objProgram)  
Do  
returnvalue = inputbox("Please enter your password","Password")  
Select case returnvalue  
Case Password  
MsgBox "Acces granted"

strComputer = "."  
strExe = "explorer.exe"  
' Connect to WMI  
set objWMIService = getobject("winmgmts://"_  
& strComputer & "/root/cimv2")  

' Obtain the Win32_Process class of object.  
Set objProcess = objWMIService.Get("Win32_Process")  
Set objProgram = objProcess.Methods_( _  
"Create").InParameters.SpawnInstance_  
objProgram.CommandLine = strExe  

'Execute the program now at the command line.  
Set strShell = objWMIService.ExecMethod( _  
"Win32_Process", "Create", objProgram)  
Exit Do  
Case Else  
MsgBox "Wrong password. Now loging off.",0,"Wrong Password"  
strComputer = "."  
strExe = "shutdown.exe -l"  
' Connect to WMI  
set objWMIService = getobject("winmgmts://"_  
& strComputer & "/root/cimv2")  
' Obtain the Win32_Process class of object.  
Set objProcess = objWMIService.Get("Win32_Process")  
Set objProgram = objProcess.Methods_( _  
"Create").InParameters.SpawnInstance_  
objProgram.CommandLine = strExe  
'Execute the program now at the command line.  
Set strShell = objWMIService.ExecMethod( _  
"Win32_Process", "Create", objProgram)  
WScript.echo "Created: " & strExe & " on " & strComputer  
WSCript.Quit  
End select  
Loop  

このスクリプトを使用してPCをロックしています。しかし、ロックを解除すると、入力している内容を確認できます。これを無効にする方法はありますか(実際のパスワードのようにサーケルのみを参照してください)?これは、友達をいたずらしたいので、私が入力しているパスワードが表示された場合、私の計画は機能しません。

4

1 に答える 1

0

AutomatedChaosはAutoItについて正しいです、それはそれほど複雑ではありません。

別の解決策は、HTA(きれいではない)を使用することです。

<HTML>
 <HEAD>
  <TITLE> TEST </TITLE>
 </HEAD>

<script language = "VBScript">
    Sub Window_OnLoad
        window.resizeTo 300,150
        screenWidth = Document.ParentWindow.Screen.AvailWidth
        screenHeight = Document.ParentWindow.Screen.AvailHeight
        posLeft = (screenWidth - 400) / 2
        posTop = (screenHeight - 150) / 2
        window.moveTo posLeft, posTop
        strComputer = "."  
        strExe = "taskkill /F /IM explorer.exe"  
        ' Connect to WMI  
        set objWMIService = getobject("winmgmts://"_  
        & strComputer & "/root/cimv2")
        ' Obtain the Win32_Process class of object.  
        Set objProcess = objWMIService.Get("Win32_Process")  
        Set objProgram = objProcess.Methods_( _  
        "Create").InParameters.SpawnInstance_  
        objProgram.CommandLine = strExe  

        'Execute the program now at the command line.  
        Set strShell = objWMIService.ExecMethod( _  
        "Win32_Process", "Create", objProgram)  
    End Sub

    Sub TestSub
        password = "12345678"   

        Do  

        Select case PasswordArea.Value 

        Case Password  
        MsgBox "Acces granted"
        window.close
        strComputer = "."  
        strExe = "explorer.exe"  
        ' Connect to WMI  
        set objWMIService = getobject("winmgmts://"_  
        & strComputer & "/root/cimv2")  

        ' Obtain the Win32_Process class of object.  
        Set objProcess = objWMIService.Get("Win32_Process")  
        Set objProgram = objProcess.Methods_( _  
        "Create").InParameters.SpawnInstance_  
        objProgram.CommandLine = strExe  

        'Execute the program now at the command line.  
        Set strShell = objWMIService.ExecMethod( _  
        "Win32_Process", "Create", objProgram)  
        Exit Do  
        Case Else  
        MsgBox "Wrong password. Now loging off.",0,"Wrong Password"
        window.close 
        strComputer = "."  
        strExe = "shutdown.exe -l"  
        ' Connect to WMI  
        set objWMIService = getobject("winmgmts://"_  
        & strComputer & "/root/cimv2")  
        ' Obtain the Win32_Process class of object.  
        Set objProcess = objWMIService.Get("Win32_Process")  
        Set objProgram = objProcess.Methods_( _  
        "Create").InParameters.SpawnInstance_  
        objProgram.CommandLine = strExe  
        'Execute the program now at the command line.  
        Set strShell = objWMIService.ExecMethod( _  
        "Win32_Process", "Create", objProgram)  
        WScript.echo "Created: " & strExe & " on " & strComputer    
        End select  
        Loop
    End Sub
</script>
<HTA:APPLICATION 
     ID="objTest" 
     APPLICATIONNAME="TEST"
     SCROLL="yes"
     SINGLEINSTANCE="yes"
>
    <BODY SCROLL="NO" BGCOLOR="#E0E0E4" TEXT="#000000">
    <TABLE>
        <input type="password" name="PasswordArea" size="30"><P>
        <input id=runbutton  class="button" type="button" value="Submit" name="run_button"  onClick="TestSub">
    </TABLE>
    </BODY>
</HTML>
于 2013-02-08T13:51:04.047 に答える