Alagor Posted October 21, 2006 Share Posted October 21, 2006 if RegRead("HKEY_LOCAL_MACHINE\SYSTEM\xxx", "") Then ProcessWaitClose("xxx.exe") $PID = Run("xxx.exe") ProcessWaitClose($PID) exit else ProcessWaitClose("2xxx.exe") $PID = Run("2xxx.exe") ProcessWaitClose($PID) exit EndIf not work As I verify if a key in the registry exists? very thanx!! Link to comment Share on other sites More sharing options...
Valuater Posted October 21, 2006 Share Posted October 21, 2006 1 Welcome to the Autoit Forums 2 we see that you are new, have a free program, in a free support forum, your first post has a hiden exe name, you are reading the registry to get the exe, you are closing the exe and you want help??? you need to explain more about your direction or purpose for doing this before anyone will help you we discourage malware in Autoit ( to say it lightly ) 8) Link to comment Share on other sites More sharing options...
Alagor Posted October 21, 2006 Author Share Posted October 21, 2006 Hello because desire to do scrip that it verifies if an entrance in the registry exists and if it exists executes an application and if it does not exist it executes another one. pardon by my ingles, but I do not speak ingles. thank you very much Link to comment Share on other sites More sharing options...
Alagor Posted October 22, 2006 Author Share Posted October 22, 2006 please help! Link to comment Share on other sites More sharing options...
PaulIA Posted October 22, 2006 Share Posted October 22, 2006 As mentioned previously, please post the FULL script without anything hidden and we'll be glad to help. Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
Uten Posted October 22, 2006 Share Posted October 22, 2006 Harsh attidtude towards a newcommer? But could you explain whats wrong with your code and what you expect it to do @Alagor? if "" = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\xxx", "") Then ProcessWaitClose("xxx.exe") $PID = Run("xxx.exe") ProcessWaitClose($PID) else ProcessWaitClose("2xxx.exe") $PID = Run("2xxx.exe") ProcessWaitClose($PID) EndIf Exit Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
Alagor Posted October 22, 2006 Author Share Posted October 22, 2006 thanks to all, but do not work my scrip fails in which always "xxx.exe" executes the application, exists or not entered it the registry. it never executes "2xxx.exe" I want that it verifies if an entrance in the registry exists, and if it exists it executes an application and if it does not exist it executes another one. thank you very much! Link to comment Share on other sites More sharing options...
smashly Posted October 22, 2006 Share Posted October 22, 2006 (edited) $var1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "XXX1") $var2 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "XXX2") $xxx1 = "C:\xxx1.exe" $xxx2 = "C:\xxx2.exe" If $var1 = $xxx1 And Not ProcessExists("xxx1.exe") Then $PID = Run($xxx1) ProcessWaitClose($PID) Exit ElseIf $var2 = $xxx2 And Not ProcessExists("xxx2.exe") Then $PID = Run($xxx2) ProcessWaitClose($PID) Exit EndIf don't know if it what your trying to do , but thought I'd post example Edited October 22, 2006 by smashly Link to comment Share on other sites More sharing options...
Alagor Posted October 22, 2006 Author Share Posted October 22, 2006 thx but not work full example: if RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Lavasoft", "") Then ProcessWaitClose("spybot.exe") $PID = Run("spybot.exe") ProcessWaitClose($PID) exit else ProcessWaitClose("ad-aware.exe") $PID = Run("ad-aware.exe") ProcessWaitClose($PID) exit EndIf solution? thx! Link to comment Share on other sites More sharing options...
Uten Posted October 22, 2006 Share Posted October 22, 2006 Now we are getting there @Alagor.And the code in my first post will work according to the logic you have provided. Obviously starting a process and then closing it immediately is not very clever I think it is time to read the helpfile. I know it is a pain in a foreign language but to put it this way reading it will help you improve your English and teach you AutoIt. Read all the pages regarding RegRead, ProcessWaitClose and Run.People have spent shitloads of time to write a great helpfile. Now it is time for you to show them that the time was well spent. By doing so you will encourage others to write a similar great help pages for other libraries and languages. Maybe even translate the helpfile to your language Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling 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