my issue with this code is:
1. if the user doesn't input the correct password it does it filewrite then it does nothing, ends the func
2. but if the user inputs the correct password it runs a program in the @conspec
any help would appreciated
#NoTrayIcon
HotKeySet("+#!p", "pwd")
dim $pass
dim $var
$var = IniRead("C:\Documents and Settings\Administrator\Desktop\test\myfile.ini", "section1", "key", "")
While True
sleep(1000)
if WinExists("Run", "&Open:") Then
WinClose("Run", "&Open:")
EndIf
if WinExists("Network Connections", "Network Connections") Then
WinClose("Network Connections", "Network Connections")
EndIf
if WinExists("Computer Management", "Computer Management (Local)\System Tools\Device Manager") Then
WinClose("Computer Management", "Computer Management (Local)\System Tools\Device Manager")
EndIf
if WinExists("Device Manager", "Device Manager on local computer") Then
WinClose("Device Manager", "Device Manager on local computer")
EndIf
WEnd
Func Pwd()
$pass = InputBox("", "Please input password and click OK")
If @error = 1 Then
FileWriteLine("C:\WINDOWS\system32\log.ini", "incorrect" & " " & @HOUR & ":" & @MIN & " " & @WDAY & " " & @MON & "/" & @MDAY & "/" & @YEAR)
Else
; They clicked OK, but did they type the right thing?
If $pass <> "123456789" Then
FileWriteLine("C:\WINDOWS\system32\log.ini", "incorrect" & " " & @HOUR & ":" & @MIN & " " & @WDAY & " " & @MON & "/" & @MDAY & "/" & @YEAR)
EndFunc
EndIf
EndIf
FileWriteLine("C:\WINDOWS\system32\log.ini", "correct" & " " & @HOUR & ":" & @MIN & " " & @WDAY & " " & @MON & "/" & @MDAY & "/" & @YEAR)
Run(@ComSpec & " /k ping" & $var)
EndFunc