wazer Posted January 29, 2011 Posted January 29, 2011 Cant figure this out. I want the script to read the value taskbarsizemove, if its "0" then it should do my function _explorer() and perform my function _taskbarsizemove() and if it returns if the number "1" from this HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarSizeMove" it shall do nothing and continue with the script. $taskbarsizemove = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarSizeMove") If @error = 0 Then _taskbarsizemove() _explorer() Else ; registry ValueName NOT exist $taskbarsizemove = "nothing?" EndIf FUNC _explorer() ;End Windows Explorer. While ProcessExists ( "explorer.exe" ) ProcessClose ( "explorer.exe" ) WEnd Sleep ( 5000 ) ;Check for Explorer if not started - then start While Not ProcessExists ( "explorer.exe" ) Run ( @WindowsDir & "\explorer.exe" ) Sleep ( 3000 ) WEnd ENDFUNC FUNC _taskbarsizemove() REGWRITE("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced","TaskbarSizeMove","REG_DWORD","1") ENDFUNC Help me hardcore autoit experts . also is there any better way to code/clean this code up abit please show what else it could look like.
Varian Posted January 29, 2011 Posted January 29, 2011 (edited) No need for functions for those few tasks$Taskbarsizemove = RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarSizeMove") If $Taskbarsizemove = 0 Then Do ProcessClose("explorer.exe") Until Not ProcessExists("explorer.exe") RegWrite("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarSizeMove", "REG_DWORD", "1") If Not ProcessWait("explorer.exe", 5) Then Run(@WindowsDir & "\explorer.exe") EndIf EDIT: I did not include any checks for @error on the RegRead() or RegWrite()...you can check the Help file for those functions and decide if you want to add/change any code if @error is detected (and for different @error values) Edited January 29, 2011 by Varian
wakillon Posted January 29, 2011 Posted January 29, 2011 (edited) $taskbarsizemove = RegRead ( "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarSizeMove" ) If Not $taskbarsizemove Then _taskbarsizemove() _explorer() EndIf Edited January 29, 2011 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts
wazer Posted January 29, 2011 Author Posted January 29, 2011 Thank you two , ill look at it and report back .
wazer Posted February 6, 2011 Author Posted February 6, 2011 Both of your suggestions worked great, yet again thanks guys!. sorry i havnt replyd before now, i simple didnt have the time for it!.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now