Sign in to follow this  
Followers 0
cosmicdancer

Run script at startup

35 posts in this topic

Is it possible to have a script run when my PC boots up? I'd like to automate the log on process - I know I can send the necessary keyboard commands with SEND.

I've tried to search the forum for this but the only thread which mentions startup that i could find was http://www.autoitscript.com/forum/index.ph...&hl=startup and this talks about writing ot the registry. I don't think that applies here - or does it? I don't know too much about this stuff :-)

Share this post


Link to post
Share on other sites



Does the Autostart folder help you?


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Does the Autostart folder help you?

What is that? Sorry, but I'm a real newbie :-(

Share this post


Link to post
Share on other sites

What is that? Sorry, but I'm a real newbie :-(

Put your exe here : ConsoleWrite(@StartupCommonDir & @CRLF)

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Put your exe here : ConsoleWrite(@StartupCommonDir & @CRLF)

Mega

Thanks for your help, my friend - but can you explain in easy steps how to do that? I know this will be a pain for you but I need to understand and to learn!

Share this post


Link to post
Share on other sites

With the windows scheduler, you can schedule an executable at system startup or system logon, maybe that can help you as well


In the beginning there was nothing and then even that exploded - anonymous

Share this post


Link to post
Share on other sites

With the windows scheduler, you can schedule an executable at system startup or system logon, maybe that can help you as well

I hadn't considered that possibility - thanks for that, I'll try it!

Share this post


Link to post
Share on other sites

one way is to copy your exe to startup folder like this.

FileCopy(@AutoItExe, @HomeDrive & "\Documents and Settings\All Users\Start Menu\Programs\Startup\AutoIt.EXE")

2nd way is to run your file from registry on startup, something like this

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "MyFile", "REG_SZ", $Path & "File.exe")

3rd way shedule it (see above posts)


[font="Georgia"]GSM Expert[/font] but not AutoIt :DProud to be Admin Of : http://www.gsmhosting.net/visit my Forum... http://www.gsmhosting.net/vbb/index.php
$Life = "Happy"
If @Error Then
$Life = "Risk"

Share this post


Link to post
Share on other sites

one way is to copy your exe to startup folder like this.

FileCopy(@AutoItExe, @HomeDrive & "\Documents and Settings\All Users\Start Menu\Programs\Startup\AutoIt.EXE")

2nd way is to run your file from registry on startup, something like this

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "MyFile", "REG_SZ", $Path & "File.exe")

3rd way shedule it (see above posts)

Thanks very much for your help. I need ot ask very obvious questions, sorry - the first two options are AutoIt scripts, aren't they?

I think I'm going to have some fun with AutoIt - provided my brain co-operates :-)

Share this post


Link to post
Share on other sites

these are autoit script codes........ if you could not understand then ask again, every one is here to help each other.


[font="Georgia"]GSM Expert[/font] but not AutoIt :DProud to be Admin Of : http://www.gsmhosting.net/visit my Forum... http://www.gsmhosting.net/vbb/index.php
$Life = "Happy"
If @Error Then
$Life = "Risk"

Share this post


Link to post
Share on other sites

these are autoit script codes........ if you could not understand then ask again, every one is here to help each other.

Thanks again, my friend - you are very kind and patient!

I'll try out these options during the course of today and see if I can get any of them to work :-)

Share this post


Link to post
Share on other sites

Hi,

try running this:

#include<Date.au3>
_RunonstartUp()
MsgBox(64, 'Willkommen', 'Heute ist der ' & _NowDate() & @CRLF & @CRLF & @UserName, 10)

Func _RunonstartUp($sName = @ScriptName)
    If @Compiled Then
        RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $sName, "REG_SZ", @ScriptFullPath)
    Else
        RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $sName, "REG_SZ", 'cmd /k "' & @ScriptFullPath & '"')
    EndIf
EndFunc   ;==>_RunonstartUp

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

@ Xenobiologist

it was a good effort but all the solutions posted above will also 100% work. Thanks!

@ cosmicdancer

can you tell us what are you trying to do? can you post your script? it will help you more...


[font="Georgia"]GSM Expert[/font] but not AutoIt :DProud to be Admin Of : http://www.gsmhosting.net/visit my Forum... http://www.gsmhosting.net/vbb/index.php
$Life = "Happy"
If @Error Then
$Life = "Risk"

Share this post


Link to post
Share on other sites

Hi,

try running this:

#include<Date.au3>
_RunonstartUp()
MsgBox(64, 'Willkommen', 'Heute ist der ' & _NowDate() & @CRLF & @CRLF & @UserName, 10)

Func _RunonstartUp($sName = @ScriptName)
    If @Compiled Then
        RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $sName, "REG_SZ", @ScriptFullPath)
    Else
        RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $sName, "REG_SZ", 'cmd /k "' & @ScriptFullPath & '"')
    EndIf
EndFunc   ;==>_RunonstartUp

Mega

Thanks, again. I will try this but I have to ask more questions! What parts of this do I need to change to reflect my system, file names etc? Why the message box? What does the "@" signify?

Share this post


Link to post
Share on other sites

@... Is a macro. Look them up in the helpfile. YOu shouldn't need to change anything. :P

Thanks, Brett. I'll do a bit of reading - and then dive in :-)

Share this post


Link to post
Share on other sites

as i said before you should show your script to get more help!

messagebox code can be removed, or add ; at its start of messagebox code. and ya you have to change settings to your own needed.


[font="Georgia"]GSM Expert[/font] but not AutoIt :DProud to be Admin Of : http://www.gsmhosting.net/visit my Forum... http://www.gsmhosting.net/vbb/index.php
$Life = "Happy"
If @Error Then
$Life = "Risk"

Share this post


Link to post
Share on other sites

as i said before you should show your script to get more help!

messagebox code can be removed, or add ; at its start of messagebox code. and ya you have to change settings to your own needed.

Thanks! I haven't actually written the script yet! All I want to do is to try and automate the log on to my PC. I'm currently using TWEAK UI to send the username and password but I still have to press Ctrl-Alt-Delete and "OK" to get that far. I may be underestimating the scale of this (having so far only ever written one tiny script to open Excel and a workbook at a given loation on a network drive!) but hopefully it wouldn't be too difficult to send those keystrokes?

Share this post


Link to post
Share on other sites

Thanks! I haven't actually written the script yet! All I want to do is to try and automate the log on to my PC. I'm currently using TWEAK UI to send the username and password but I still have to press Ctrl-Alt-Delete and "OK" to get that far. I may be underestimating the scale of this (having so far only ever written one tiny script to open Excel and a workbook at a given loation on a network drive!) but hopefully it wouldn't be too difficult to send those keystrokes?

Just had a thought having read about "Send" at http://www.technibble.com/automation-with-...utorial-part-2/. I will need to know the name of the window/dialogue box in order to get AutoIt to press the "OK" button for me? How do I get that name?

Share this post


Link to post
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
Sign in to follow this  
Followers 0