adrieclipse Posted November 26, 2020 Share Posted November 26, 2020 #include <MsgBoxConstants.au3> While 1 $r_hash = 0 Sleep(1000) $r_hash += 1 $r_var = RegEnumVal("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $r_hash) If @error <> 0 Then ExitLoop Else RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $r_var) $var = RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $r_var) MsgBox(4096, "Program files are in:", $var) ProcessClose($r_var) EndIf WEnd Why my Process not close? Link to comment Share on other sites More sharing options...
Developers Jos Posted November 26, 2020 Developers Share Posted November 26, 2020 26 minutes ago, adrieclipse said: Why my Process not close? No enough information, but doubt that the registry contains the proces name, but rather the fully qualified name (path+program). So, What does happen ? Do you get any MSgBox() at all? Add error checking to get feedback from the ProcessClose() function! Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Danp2 Posted November 26, 2020 Share Posted November 26, 2020 A few issues with your coding -- You set $r_hash equal to 0 inside your loop. This needs to occur before the loop to avoid reading the same registry key over and over Your initial RegRead isn't needed (you aren't capturing the resulting value) $r_var doesn't contain the full executable name (no extension), so you can't use it to close a process Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Nine Posted November 26, 2020 Share Posted November 26, 2020 And why do you need a sleep in there ? I can't see no reason for that. And why do rereread the registry when you got all you need with the very first read ? “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
adrieclipse Posted November 26, 2020 Author Share Posted November 26, 2020 19 minutes ago, Jos said: No enough information, but doubt that the registry contains the proces name, but rather the fully qualified name (path+program). So, What does happen ? Do you get any MSgBox() at all? Add error checking to get feedback from the ProcessClose() function! Jos How can i do he read the program name? msbox say me panth+program, but is possible say only program and close the process? Link to comment Share on other sites More sharing options...
adrieclipse Posted November 26, 2020 Author Share Posted November 26, 2020 17 minutes ago, Danp2 said: A few issues with your coding -- You set $r_hash equal to 0 inside your loop. This needs to occur before the loop to avoid reading the same registry key over and over Your initial RegRead isn't needed (you aren't capturing the resulting value) $r_var doesn't contain the full executable name (no extension), so you can't use it to close a process msgbox say path+program, how possible msgbox say only program? Link to comment Share on other sites More sharing options...
Nine Posted November 26, 2020 Share Posted November 26, 2020 33 minutes ago, adrieclipse said: how possible msgbox say only program? see _PathSplit in help file “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
adrieclipse Posted November 26, 2020 Author Share Posted November 26, 2020 17 minutes ago, Nine said: see _PathSplit in help file Thanks is solve Link to comment Share on other sites More sharing options...
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