Jump to content

Recommended Posts

Posted (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 :x

Edited by doxx12
Posted

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

Posted

First Welcolme to the Forum !

and you can create a tray item for choose if your soft will restart with windows like this ! Posted Image

#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.0WIN 8.1 X64 - Other Example Scripts

Posted

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

Posted

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

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.. :x

Posted (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 by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Posted

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

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
  • Recently Browsing   0 members

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