Jump to content

HELP and my scrip please!


Alagor
 Share

Recommended Posts

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 :ph34r::lmao:

As I verify if a key in the registry exists?

very thanx!!

Link to comment
Share on other sites

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)

NEWHeader1.png

Link to comment
Share on other sites

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

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
Link to comment
Share on other sites

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

$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 by smashly
Link to comment
Share on other sites

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

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 :whistle:

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 ;)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...