Jump to content

Action Occur only on second click (please help)


 Share

Recommended Posts

Am trying to use the file which reboot PC, here is the link http://www.installsite.org/files/RebootMe.zip

I want to create a script which let program start only if is it start for the second the time,

On the fist start of the program there should not be no action but if it start for the second then this action should take place reboot the PC

Or if the program is start you always use ctrl+c to stop it

But if it clicks for the second time it should not be stop with (ctrl+c) but the action go on to reboot the PC

I will be every greatful it some one can help thank you with a script to do this

or a script to triger the rebootme.exe on on a second click will also be fine

Link to comment
Share on other sites

If I understand you correctly, then you can use _Singleton() to verify if the script is already running, and if it then simply reboot the computer

an example:

#include "Misc.au3"
if _Singleton("MyScript",1) = 0 Then
;do whatever you wanted the second time the script is run...
else
while 1
if _IsPressed("11") and _IsPressed("43") Then exit
sleep(50)
wend
endif
Link to comment
Share on other sites

thanks for the replay,

Think I did explain well this PC can only be rebooted with a file RebootMe.exe located here C:\Programme\RebootMe\RebootMe.exe

The PC is in German? This RebootMe.exe is link to a program which when chick logout on this program it trigger the rebootme.exe to reboot the PC

For whatever reason when the PC starts this logout Program just trigger the rebootme.exe file so the PC keeps on restarting nonstop.

So I want a script that will ignore the first click on rebootme.exe so the PC will not reboot but if someone click the to logout the PC can reboot and that will be the second

Click on the rebootme.exe file or an exe script which when U click for the first time I will not take any action but the second time it should tell reboome.exe file located

In (C:\Programme\RebootMe\RebootMe.exe) then that can reboot the PC.

http://www.installsite.org/files/RebootMe.zip

this the link to the file, All what I want to do is on the first click on the rebootme.exe it should not respond but when it is click for the second time the action should take place?

Link to comment
Share on other sites

Why use an external rebootme ??? Windows have the command shutdown

No, all Windows OS's doesn't have the Shutdown executable(dos application), Windows XP has it, but not ALL Windows OS's

Edit:

Example code of how to know if the program has been run before:

; At top of script
If FileExists(@TempDir & "\rebooter.run") Then
    
    Exit
    
Else
    
    FileWrite(@TempDir & "\rebooter.run", "1")
    
EndIf

; do your code here
Edited by FreeFry
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...