kobiemexx 0 Posted February 11, 2007 Am trying to use the file which reboot PC, here is the link http://www.installsite.org/files/RebootMe.zipI 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 PCOr if the program is start you always use ctrl+c to stop itBut if it clicks for the second time it should not be stop with (ctrl+c) but the action go on to reboot the PCI will be every greatful it some one can help thank you with a script to do thisor a script to triger the rebootme.exe on on a second click will also be fine Share this post Link to post Share on other sites
improbability_paradox 0 Posted February 11, 2007 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 Share this post Link to post Share on other sites
Jos 2,164 Posted February 11, 2007 What is the purpose of the script ? 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. Share this post Link to post Share on other sites
kobiemexx 0 Posted February 11, 2007 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 PCFor 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 secondClick 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 locatedIn (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? Share this post Link to post Share on other sites
Shevilie 1 Posted February 12, 2007 Why use an external rebootme ??? Windows have the command shutdown Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit Share this post Link to post Share on other sites
FreeFry 2 Posted February 12, 2007 (edited) 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 February 12, 2007 by FreeFry Share this post Link to post Share on other sites
kobiemexx 0 Posted February 12, 2007 Guys thanks for the help I have just find a way out thx Bets regards Share this post Link to post Share on other sites