codejunkie 0 Posted March 3, 2005 When I FIRST run this script on a computer it only applies half the reg changes then if i run it again it applies all of themLog says 37 first timeand 78 second time???The program needs to have and file called cust_winnt.inf in the same directrymine is as followsexpandcollapse popup[tweaker_debug] create_log = 1 datetime_log_file = 1 log_on_desktop = 1 end_summary = 0 error_messages = 0 current_user_only = 0 [device_manager] show_nonpressent_devices = 1 show_details = 1 [file_system] unknown_files_in_notepad = 1 dll_registration = 1 ocx_registration = 1 ntfs_last_access_update = 0 ntfs_8_3_name_creation = 0 recycle_bin = 0 [windows] notepad_status = 1 showmenudelay = 2 shortcut_arrows = 0 tour_bubble = 0 picture_fax_viewer = 0 classic_control_panel = 1 logon_type = "clasic" movie_previews = 0 bsod_autorestart = 0 error_reports = 0 ms_installer_rollback = 0 reverse_mouse = 0 x-mouse = 0 remote_desktop = 0 system_restore = 0 hide_inactive_icons = 0 num_lock = 1 clean_page_file_on_reboot = 1 last_known_good = 0 quick_reboot = 1 shutdown_reason_ui = 0 no_internet_open_with = 1 disable_page_files = 1 system_cache = "desktop" auto_boot_optimize = 1 web_driver_search = 0 ;prefetcher Value Data: ("disabled" = disabled, app_launch_only = Application launch prefetching, boot_only = Boot prefetching, both = Both prefetching) prefetcher = "boot_only" report_boot_ok = 0 password_on_resume = 0 [networking] logoff_sync = "quick" force_guest = 0 ;net_throughput = max_net OR min_mem OR balance net_thoughput = "max_net" default_hidden_shares = 1 [my_computer] shared_docs = 0 statusbar = 1 hidedrive_local = 0 hidedrive_currentuser = 0 denydrive_local = 0 denydrive_currrentuser = 0 ;Close Optical drive tray requires CDR.exe from MSFN.org close_optical_drive_tray = 1 [my_computer_rightclick] services = 1 control_panel = 1 add_remove = 1 logoff = 1 restart = 1 shutdown = 1 device_man = 1 drive_clean = 1 [desktop] paintdesktopversion = 1 screensaveactive = 0 autoendtasks = 1 desktop_clean = 0 allow_remote_connection = 0 [ie] start_page = "about:blank" history_days = "2" statusbar = 1 connection_wiz = 0 auto_image_resize = 0 [services] win_time = 0 universal_pnp = 0 win_messanger = 0 indexing = 0 [security_center] disable_all = 0 firewall_watch = 0 antivirus_watch = 0 win_update_watch = 0 first_run = 0source code for v1.1005beta1 is attached.is there an issue with access rights first time round? or is my logging system just not logging it? I am in the middle of rewriting the program but being able to fix this problem would be greatFor more information, beta0 hosted hereTH2k_Win_Tweaker.au3 Share this post Link to post Share on other sites
codejunkie 0 Posted March 18, 2005 (edited) Fine no one will help so I have come up with this $i = 0 For $i = 0 to 3 Step 1 $Result = RegWrite($KeyName,$Valname,$ValType,$EditedVal) If $Result = 1 then Return "Successful" Next I think it was because when the key didnt exist it created that instead of creating new val under that key Edited March 18, 2005 by codejunkie Share this post Link to post Share on other sites
steve8tch 1 Posted March 18, 2005 I really like this program - looks really good. When you run the program on different PC - is it the same settings that fail - or is it random settings that fail. If so this needs to looked at as a possible bug - OR - the help file needs to be updated to point out that a registry value needs to be created before data gets added. Share this post Link to post Share on other sites
codejunkie 0 Posted March 25, 2005 I really like this program - looks really good.<{POST_SNAPBACK}>Cheers mate, least someones interestedIm currently writing v2 at the moBeing a VB programmer I just want to create a module for things like logging, reg editing so I can use commands likelog.start log.stop reg.add reg.mod reg.del.val reg.del.key Share this post Link to post Share on other sites
codejunkie 0 Posted March 28, 2005 (edited) its always same tweaks that error Just think its coz the keys dont exist and it one create the command only creates one 'steep' it is they doesnt exist it creates that but thinks its done at that so exits before the value is added, some some only work after the program has been run 3 times because there so beep into the registry I have redone the code for version 2 heres the latest code I have for it expandcollapse popupFunc TweakerRegEdit($Action,$KeyName,$ValName,$ValType,$NewValue,$EditStart) Select Case $Action = "RegWrite" $i = 0 For $i = 0 to 3 Step 1 $Result = RegWrite($KeyName,$Valname,$ValType,$NewValue) If $Result = 1 then Return "Successful" Next Return "Error - error writing registry key or value" Case $Action = "RegDeleteVal" $i = 0 For $i = 0 to 3 Step 1 $Result = RegDelete($KeyName,$Valname) If $Result = 1 then Return "Successful" Next Select Case $Result = 0 Return "Error - key/value does not exists" Case $Result = 2 Return "Error - error deleting key/value" EndSelect Case $Action = "RegDeleteKey" $i = 0 For $i = 0 to 3 Step 1 $Result = RegDelete($KeyName) If $Result = 1 then Return "Successful" Next Select Case $Result = 0 Return "Error - key/value does not exists" Case $Result = 2 Return "Error - error deleting key/value" EndSelect Case $Action = "RegEditVal" $CurrentRegStringVal = RegRead($KeyName,$Valname) Select case @error = 0 $ReplacementStringLen = StringLen($NewValue) $CurrentRegStringLen = StringLen($CurrentRegStringVal) $TrimXCharsOfEnd = $CurrentRegStringVal - ($ReplacementStringLen + $EditStart) $TrimedRegStringBeg = StringLeft($CurrentRegStringVal,$EditStart) $TrimedRegStringEnd = StringRight($CurrentRegStringVal,$TrimXCharsOfEnd) $EditedVal = $TrimedRegStringBeg & $NewValue & $TrimedRegStringEnd msgbox(64,"","Old Value = " & $CurrentRegStringVal & chr(13) & "New Value = " & $EditedVal) ;RegWrite($KeyName,$Valname,$ValType,$EditedVal) $i = 0 For $i = 0 to 3 Step 1 $Result = RegWrite($KeyName,$Valname,$ValType,$EditedVal) If $Result = 1 then Return "Successful" Next Case @error = 1 Return "Error - unable to open requested key" case @error = -1 Return "Error - unable to open requested value" case @error = -2 Return "Error - value type not supported" EndSelect Case Else Return "Error - Invalid Action" EndSelect EndFunc Now thinking about it maybe I should have it so you can cusomize how many times it tries, or get it just to count the \ in each key +- a few and hope that it returns failed if it doesnt write THAT actual data to the registry in stead of returning turning successfull if it just write a key that the value resides in because it doesnt already exist Some testing required I think! Ok thats just odd tried this $Action = "RegWrite" $KeyName = "HKEY_LOCAL_MACHINE\SOFTWARE\THC2k\Test1\Test2\Test3\Test4\Test5" $ValName = "Value" $ValType = "REG_DWORD" $NewValue = 15 $EditStart = 1 TweakerRegEdit($Action,$KeyName,$ValName,$ValType,$NewValue,$EditStart) And it still worked even though it was creating more that 3 keys/values. So not a prob that the key doesnt exist, something else but corrects its self after being run a few times?? something to do with access rights? but why doesnt it stop it everytime then? this is just odd! Edited March 28, 2005 by codejunkie Share this post Link to post Share on other sites