doxx12 Posted December 11, 2010 Share Posted December 11, 2010 (edited) I'm looking for a script that launches my program after resetting the computer.But when the user resets the computer. example: 1.run my aplication. 2.there is nothing 3.I'm resetting the computer 4.When you turn on your computer 5.show hello message 6.that every time you turn on the computer says hello message sorry for bad english Edited December 11, 2010 by doxx12 Link to comment Share on other sites More sharing options...
maestro Posted December 11, 2010 Share Posted December 11, 2010 Can you not just stick the script in the "start-up" folder? and if this doesn't work, you can always write a registry key for it. Here is the 2 common ones: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run] [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run] Thanks, Ilmaestro. Hello, World!... LAME lol Link to comment Share on other sites More sharing options...
wakillon Posted December 11, 2010 Share Posted December 11, 2010 First Welcolme to the Forum !and you can create a tray item for choose if your soft will restart with windows like this ! #include <Constants.au3> Global $_StartItem, $_RegTitleKey = 'YourSoftName' Opt ( "TrayOnEventMode", 1 ) ;Opt ( "TrayMenuMode", 1 ) ;GUICreate ( "My GUI" ) ;GUISetState ( ) $_StartItem = TrayCreateItem ( "Start With Windows" ) $_RegRead = RegRead ( "HKCU\Software\Microsoft\Windows\CurrentVersion\Run", $_RegTitleKey ) If $_RegRead <> '' Then TrayItemSetState ( $_StartItem, $TRAY_CHECKED ) TrayItemSetOnEvent ( $_StartItem, "_StartWithWindows" ) MsgBox ( 0, 'message', 'hello !' ) While 1 Sleep ( 30 ) WEnd Func _StartWithWindows ( ) If @Compiled Then $_ItemGetState = TrayItemGetState ( $_StartItem ) If $_ItemGetState = 64+1 Then RegWrite ( "HKCU\Software\Microsoft\Windows\CurrentVersion\Run", $_RegTitleKey, "REG_SZ", @ScriptFullPath ) Else RegDelete ( "HKCU\Software\Microsoft\Windows\CurrentVersion\Run", $_RegTitleKey ) EndIf EndIf EndFunc ;==> _StartWithWindows ( ) AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
dox Posted December 11, 2010 Share Posted December 11, 2010 MsgBox should run only after the restart. Not when the run immediately exe. MY english is bad sorry Link to comment Share on other sites More sharing options...
somdcomputerguy Posted December 12, 2010 Share Posted December 12, 2010 MsgBox should run only after the restart. Not when the run immediately exe.1. Have it check if a file exist.2. If it doesn't exist, don't MsgBox yet, create the file now.3. If it does, MsgBox. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
doxx12 Posted December 12, 2010 Author Share Posted December 12, 2010 2. Link to comment Share on other sites More sharing options...
Developers Jos Posted December 12, 2010 Developers Share Posted December 12, 2010 (edited) 2.Why did you create a second account? Edited December 12, 2010 by Jos 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. Link to comment Share on other sites More sharing options...
dox Posted December 12, 2010 Share Posted December 12, 2010 I did not intentionally :S Link to comment Share on other sites More sharing options...
dox Posted December 12, 2010 Share Posted December 12, 2010 I saved the old akaunt in mozzila, and was I went to google chrome so I opened dooxx12 sry.Sorry for my english is bed Link to comment Share on other sites More sharing options...
Developers Jos Posted December 12, 2010 Developers Share Posted December 12, 2010 I did not intentionally :Sdon't bs ... the doxx12 will be gone soon. Next time you loose all id's.Jos 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. Link to comment Share on other sites More sharing options...
dox Posted December 12, 2010 Share Posted December 12, 2010 ok,whether you can delete these posts that do not spoil the topic? Link to comment Share on other sites More sharing options...
anixon Posted December 12, 2010 Share Posted December 12, 2010 I'm looking for a script that launches my program after resetting the computer.But when the user resets the computer.example: 1.run my aplication.2.there is nothing3.I'm resetting the computer4.When you turn on your computer 5.show hello message6.that every time you turn on the computer says hello messagesorry for bad english If you are running Windows Vista you may consider a Scheduler Task found in Control Panel/Admin/Scheduler Task. Scheduler Tasks allow you to run a script based on an event. The only issue then would be to display a Hello message which you can script Ant.. Link to comment Share on other sites More sharing options...
Developers Jos Posted December 12, 2010 Developers Share Posted December 12, 2010 ok,whether you can delete these posts that do not spoil the topic?you spoiled your own topic ... not me.. 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. Link to comment Share on other sites More sharing options...
dox Posted December 12, 2010 Share Posted December 12, 2010 ok,help me Link to comment Share on other sites More sharing options...
wakillon Posted December 13, 2010 Share Posted December 13, 2010 (edited) ok,help me May be, this way... _Date_Time_GetTickCount ( ) Function Returns a Number of milliseconds that have elapsed since Windows was started #include <Date.au3> If @Compiled Then RegWrite ( "HKCU\Software\Microsoft\Windows\CurrentVersion\Run", 'hello', "REG_SZ", @ScriptFullPath ) $_SecondSinceWindowsStarted = Round ( _Date_Time_GetTickCount ( )/1000 ) ; ConsoleWrite ( " : " & $_SecondSinceWindowsStarted & @Crlf ) If $_SecondSinceWindowsStarted < 70 Then MsgBox ( 0, 'message', $_SecondSinceWindowsStarted & ' sec' & @Crlf & 'hello !' ) Exit 70 is 1m10sec, change it like you want... Compil it, run it one time for the regwrite part and restart... Edited December 13, 2010 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
dox Posted December 14, 2010 Share Posted December 14, 2010 May be, this way... _Date_Time_GetTickCount ( ) Function Returns a Number of milliseconds that have elapsed since Windows was started #include <Date.au3> If @Compiled Then RegWrite ( "HKCU\Software\Microsoft\Windows\CurrentVersion\Run", 'hello', "REG_SZ", @ScriptFullPath ) $_SecondSinceWindowsStarted = Round ( _Date_Time_GetTickCount ( )/1000 ) ; ConsoleWrite ( " : " & $_SecondSinceWindowsStarted & @Crlf ) If $_SecondSinceWindowsStarted < 70 Then MsgBox ( 0, 'message', $_SecondSinceWindowsStarted & ' sec' & @Crlf & 'hello !' ) Exit 70 is 1m10sec, change it like you want... Compil it, run it one time for the regwrite part and restart... Thanks bro.works 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