Jump to content

script after restart run


doxx12
 Share

Recommended Posts

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

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

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

Link to comment
Share on other sites

  • Developers

I did not intentionally :S

don'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

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

Link to comment
Share on other sites

  • Developers

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

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

Link to comment
Share on other sites

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

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