Hmm, maybe I shouldn't have opened that bottle of wine last night . . .
This might be by design, but if i change the sleep to 60 seconds, pressing CRTL + F10 won't do anything until those 60 seconds are up, which i guess is obvious. But is there any way around this ? Also, any tips or constructive critisism on how to make this better would be very welcome.
Many thanks guys.
Code:
Break On
;SetConsole("Hide")
;region
If @DOS >= "5.0"
Goto START
Else
MessageBox("SetIEPass can only be used on Windows 2000 or above." + Chr(13) + Chr(10) + "" + Chr(13) + Chr(10) +
"The version detected on this computer is " + @PRODUCTTYPE, "TungstenBlue LLP", 4112)
Exit 0
EndIf
;endregion
:START
Global $100, $200, $NewPass, $IniFolder, $Period01, $Period02, $Period03, $Period04, $Period05,
$Period06, $Period07, $Period08, $Period09, $Period10, $User, $UserName, $DomainName
If Exist("%ASEEXEPATH%SetIEPass.ini")
$IniFolder = %ASEEXEPATH% + "SetIEPass.ini"
Else
; Just for testing
$IniFolder = "C:\TechProgs\Scripting\Forms\SetIEPass\SetIEPass.ini"
; $IniFolder = "D:\Supoort\SetIEPass\SetIEPass.ini"
;MessageBox("Cannot find SetIEPass.ini !" + Chr(13) + Chr(10) + "" + Chr(13) + Chr(10) +
;"Please ensure that SetIEPass.ini is in the same folder as SetIEPass.exe.", "TungstenBlue LLP", 16)
;Exit 0
EndIf
$Period01 = Trim(ReadProfileString ($IniFolder,"PeriodStart","Period01"))
$Period02 = Trim(ReadProfileString ($IniFolder,"PeriodStart","Period02"))
$Period03 = Trim(ReadProfileString ($IniFolder,"PeriodStart","Period03"))
$Period04 = Trim(ReadProfileString ($IniFolder,"PeriodStart","Period04"))
$Period05 = Trim(ReadProfileString ($IniFolder,"PeriodStart","Period05"))
$Period06 = Trim(ReadProfileString ($IniFolder,"PeriodStart","Period06"))
$Period07 = Trim(ReadProfileString ($IniFolder,"PeriodStart","Period07"))
$Period08 = Trim(ReadProfileString ($IniFolder,"PeriodStart","Period08"))
$Period09 = Trim(ReadProfileString ($IniFolder,"PeriodStart","Period09"))
$Period10 = Trim(ReadProfileString ($IniFolder,"PeriodStart","Period10"))
Do
Select
Case Trim(Left(@TIME,5)) = $Period01
ChangeUser ("SetIEPass", @DOMAIN)
Case Trim(Left(@TIME,5)) = $Period02
ChangeUser ("SetIEPass", @DOMAIN)
Case Trim(Left(@TIME,5)) = $Period03
ChangeUser ("SetIEPass", @DOMAIN)
Case Trim(Left(@TIME,5)) = $Period04
ChangeUser ("SetIEPass", @DOMAIN)
Case Trim(Left(@TIME,5)) = $Period05
ChangeUser ("SetIEPass", @DOMAIN)
Case Trim(Left(@TIME,5)) = $Period06
ChangeUser ("SetIEPass", @DOMAIN)
Case Trim(Left(@TIME,5)) = $Period07
ChangeUser ("SetIEPass", @DOMAIN)
Case Trim(Left(@TIME,5)) = $Period08
ChangeUser ("SetIEPass", @DOMAIN)
Case Trim(Left(@TIME,5)) = $Period09
ChangeUser ("SetIEPass", @DOMAIN)
Case Trim(Left(@TIME,5)) = $Period10
ChangeUser ("SetIEPass", @DOMAIN)
EndSelect
? "I am a banana"
Sleep 60
If KBHit()
Get $hit
$hit = @ERROR
EndIf
Until $hit = 103
Exit 0
Function ChangeUser ($uName, $dName)
$100 = Rnd(999)
$200 = Rnd(999)
$NewPass = $200$300
$UserName = $uName
$DomainName = $dName
$User = GetObject("WinNT://" + $DomainName + "/" + $UserName + ",user")
$User.Description = ("IE pwd = " + "'" + $NewPass + "'" + " , changed at " + @TIME + " on " + @DATE)
$User.SetPassword ($NewPass)
$User.SetInfo
Set $User = 0
$WshShell = CreateObject ("WScript.Shell")
$WshShell.LogEvent (0, "Internet Password Changed to " + "'" + $NewPass +"'")
EndFunction
The INI File
Code:
[PeriodStart]
Period01=08:30
Period02=09:00
Period03=09:50
Period04=11:00
Period05=12:45
Period06=14:00
Period07=15:10
Period08=16:15
Period09=19:15
Period10=20:15
[edit]
LongLine-Police visited this post