t0ddie Posted February 24, 2006 Share Posted February 24, 2006 i have been trying to make workarounds for a simple task but keep running into issues! i am reading a registry value from within a loop and when the registry value changes the script exits out of the loop. the problem is that sometimes the value that is entered (from another program) is the same as the value that is already in the registry key. so my script never exits the loop! one workaround i used was to delete the registry value. that way it will change every time, but this is not desirable because i need to leave the value there before i write the new value.. or other functionality doesnt work. i was wondering if its possible to just check if the registry was written to, or if there is any other workaround. i need to detect a registry value being entered even if the value is the same as it was before. Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
t0ddie Posted February 26, 2006 Author Share Posted February 26, 2006 (edited) here is some pseudo-code to explain what i want to do.while 1 $value1 = RegRead("HKEY_CURRENT_USER\Software\Anysoft\Game", "Last login") Do sleep(100) $value2 = RegRead("HKEY_CURRENT_USER\Software\Anysoft\Game", "Last login") Until $value2 <> $value1 msgbox(0,"passed","passed") wendif the value of "Last login" is different every time, then this works. but sometimes the same value is written to the registry key, so i tried this workaroundwhile 1 $value1 = "" RegDelete("HKEY_CURRENT_USER\Software\Anysoft\Game", "Last login") Do sleep(100) $value2 = RegRead("HKEY_CURRENT_USER\Software\Anysoft\Game", "Last login") Until $value2 <> $value1 msgbox(0,"passed","passed") wendbut i dont want to delete the registry value because another program is using this registry value.so i was thinking maybe there was a way to determine what TIME a value was written to the registry.or some other way of detecting it.this is where im stuck.thanks. Edited February 26, 2006 by t0ddie Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
Valik Posted February 26, 2006 Share Posted February 26, 2006 I know there is no way in hell you will be able to understand and implement the answer without tremendous help from somebody (not me). However, I will still tell you against my better judgement that what you are looking for is the Windows API function RegNotifyChangeKeyValue(). Link to comment Share on other sites More sharing options...
t0ddie Posted February 26, 2006 Author Share Posted February 26, 2006 makes sense. thanks. your right its beyond my capabilities. its the idea i came up with as a workaround for my dillemma... although im not experienced in how to go about doing it. and yes i would need some serious help to do it Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
mikeytown2 Posted February 27, 2006 Share Posted February 27, 2006 This might helphttp://www.sysinternals.com/utilities/regmon.html Email: POP3 & SMTP using SSL/TLS (OpenSSL)Email: IMAPEmail: Base64 & SMTP login & Send email direct to MX Server (thanks blindwig)Win: Hook Registry ChangesWin: Read/Write to Alternate Data Streams (ini example)Utility: GPS Distance Calculations, Vincenty and Haversine formulas; angles and elevationUtility: Dell Laser Printer (3000-5100) - Print LoggerUtility: Reset Router when Wireless Link FailsUtility: ImageMagick Batch jpg ProcessorVideo HCenc Batch FrontendVideo: *DEAD* YouTube Video Encoder (avs/avi to flv)Software On CD's I Like<<back|track3 Ultimate Boot CD for Windows SpinRite Ubuntu ophcrack Link to comment Share on other sites More sharing options...
t0ddie Posted February 28, 2006 Author Share Posted February 28, 2006 that is helpful but its not able to be included into a script and run on any machine. what im looking to do is be able to detect this in a script, not from a third party application. Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
Xenobiologist Posted February 28, 2006 Share Posted February 28, 2006 that is helpful but its not able to be included into a script and run on any machine.what im looking to do is be able to detect this in a script, not from a third party application.Hmmh,I don´t know if this might help, but I give it a try.Can you copy the RegValue change it maybe to Login2 an then you campare?So you´ll have and additional RegKey.So long,Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
t0ddie Posted February 28, 2006 Author Share Posted February 28, 2006 no that would not work. it would just present the same issue. Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
Xenobiologist Posted February 28, 2006 Share Posted February 28, 2006 no that would not work.it would just present the same issue.HI,sure. Next try. What is the value of that regkey? Maybe you could change the value without stopping the other apps dealing with it correctly. And then you can look for your change to be overwritten.So long,Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
t0ddie Posted February 28, 2006 Author Share Posted February 28, 2006 no that wont work either. i have no control over what the other application does. another possibility would be to check when a registry key was read, but then we run into the same problem. dont have any autoit functions for that. i could change the reg key value after the application has used it only problem is i cant "detect" when the other application has used the registry key. Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
mikeytown2 Posted March 3, 2006 Share Posted March 3, 2006 I know there is no way in hell you will be able to understand and implement the answer without tremendous help from somebody (not me). However, I will still tell you against my better judgement that what you are looking for is the Windows API function RegNotifyChangeKeyValue().@t0ddieThis looks like your best bet then... look around the forum and see how other people called the windows API. Please don't make a new topic, it gets kinda annoying; you made about 3 for your telnet app. I haven't had the need to do this so i don't know how to do it. Good Luck. Email: POP3 & SMTP using SSL/TLS (OpenSSL)Email: IMAPEmail: Base64 & SMTP login & Send email direct to MX Server (thanks blindwig)Win: Hook Registry ChangesWin: Read/Write to Alternate Data Streams (ini example)Utility: GPS Distance Calculations, Vincenty and Haversine formulas; angles and elevationUtility: Dell Laser Printer (3000-5100) - Print LoggerUtility: Reset Router when Wireless Link FailsUtility: ImageMagick Batch jpg ProcessorVideo HCenc Batch FrontendVideo: *DEAD* YouTube Video Encoder (avs/avi to flv)Software On CD's I Like<<back|track3 Ultimate Boot CD for Windows SpinRite Ubuntu ophcrack Link to comment Share on other sites More sharing options...
mikeytown2 Posted March 18, 2006 Share Posted March 18, 2006 Looks like you weren't the only one looking on how to do this... i posted a solution here Email: POP3 & SMTP using SSL/TLS (OpenSSL)Email: IMAPEmail: Base64 & SMTP login & Send email direct to MX Server (thanks blindwig)Win: Hook Registry ChangesWin: Read/Write to Alternate Data Streams (ini example)Utility: GPS Distance Calculations, Vincenty and Haversine formulas; angles and elevationUtility: Dell Laser Printer (3000-5100) - Print LoggerUtility: Reset Router when Wireless Link FailsUtility: ImageMagick Batch jpg ProcessorVideo HCenc Batch FrontendVideo: *DEAD* YouTube Video Encoder (avs/avi to flv)Software On CD's I Like<<back|track3 Ultimate Boot CD for Windows SpinRite Ubuntu ophcrack 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