Jump to content

Startup Script


Guest BL@(K-R34P3R

Recommended Posts

Guest BL@(K-R34P3R

StartupFunc()
Func StartupFunc()
   Run('"C:\Program Files\AutoIt3\AutoIt.chm"', "C:\Program Files\AutoIt3")
   WinWaitActive("AutoIt Help")
   WinSetState("AutoIt Help", "", @SW_MAXIMIZE)
   Run('"C:\Program Files\AutoIt3\AU3_Spy.exe"', "C:\Program Files\AutoIt3")
   WinWaitActive("AutoIt v3 Active Window Info")
   WinSetState("AutoIt v3 Active Window Info", "", @SW_MAXIMIZE)
   Run('"C:\Program Files\AutoIt3\SciTe\SciTE.exe"', "C:\Program Files\AutoIt3\SciTe")
   Sleep(500)
   Run('"C:\Program Files\Internet Explorer\IEXPLORE.EXE"', "C:\Program Files\Internet Explorer")
   Sleep(2000)
   WinSetTitle ( "Dell - Client & Enterprise Solutions, Software, Peripherals, Services - Microsoft Internet Explorer", "", "Internet Explorer" )
   WinSetState("Internet Explorer", "", @SW_MAXIMIZE)
   MouseClick("left", 300, 100, 1)
   Send("http://www.autoitscript.com/forum/index.php?act=idx{ENTER}")
EndFunc

Just a startup script. Gives me a stupid error...

>"C:\Program Files\AutoIt3\autoit3.exe" /ErrorStdOut "C:\Documents and Settings\Randall Degges\My Documents\Scripts\Startup.au3"   

C:\Documents and Settings\Randall Degges\My Documents\Scripts\Startup.au3 (32) : ==> Unable to execute the external program.:

Run('"C:\Program Files\AutoIt3\AutoIt.chm"', "C:\Program Files\AutoIt3")

>Exit code: 0    Time: 0.219

Why isn't it working???
Link to post
Share on other sites

you can run .exe with run, but to open another program such as .txt files.. you need to run notepad.

i dont know what you need to run .chm.. but see what program opens that.. and then run that.

EDIT: ahahaaa matt you beat me by like 2 seconds

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to post
Share on other sites

i have no idea what you are trying to do...

but the help file opens.. it is more advanced format than a simple .txt file

so, just doubleclick it

or right click run. why are you trying to open the help file from a script?

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to post
Share on other sites
Guest BL@(K-R34P3R

A startup script, so when you start the computer it automatically runs all the scripting tools, helpfile, scite, winspy, etc... and also opens up the autoit forums. How would I open the help file through Start->Run?

Link to post
Share on other sites
Guest BL@(K-R34P3R

Fixed! I now know the problem, needed to add a few sleeps. Here is new script:

StartupFunc()
Func StartupFunc()
   Send("{LWIN}{ENTER}")
   MouseClick("left", 237, 875, 1)
   Sleep(500)
   Send("C:\Program Files\AutoIt3\AutoIt.chm{ENTER}")
  ;Run('"C:\Program Files\AutoIt3\AutoIt.chm"', "C:\Program Files\AutoIt3")
   WinWaitActive("AutoIt Help")
   WinSetState("AutoIt Help", "", @SW_MAXIMIZE)
   WinSetState("AutoIt Help", "", @SW_MINIMIZE)
   Sleep(500)
   Run('"C:\Program Files\AutoIt3\AU3_Spy.exe"', "C:\Program Files\AutoIt3")
   WinWaitActive("AutoIt v3 Active Window Info")
   WinSetState("AutoIt v3 Active Window Info", "", @SW_MINIMIZE)
   Sleep(500)
   Send("{LWIN}{ENTER}")
   Sleep(500)
   MouseClick("left", 237, 875, 1)
   Sleep(500)
   Send("C:\Documents and Settings\Randall Degges\My Documents\Scripts{ENTER}")
   WinWaitActive("Scripts")
   WinSetState("Scripts", "", @SW_MINIMIZE)
   Sleep(500)
   Run('"C:\Program Files\Internet Explorer\IEXPLORE.EXE"', "C:\Program Files\Internet Explorer")
   Sleep(2000)
   WinSetTitle ( "Dell - Client & Enterprise Solutions, Software, Peripherals, Services - Microsoft Internet Explorer", "", "Internet Explorer" )
   WinSetState("Internet Explorer", "", @SW_MAXIMIZE)
   Sleep(500)
   MouseClick("left", 300, 100, 1)
   Send("http://www.autoitscript.com/forum/index.php?act=idx{ENTER}")
EndFunc

Question:

How can I make this script into a yes or no script. So that the user can enter either yes, to start it, or no, to no start it...

Link to post
Share on other sites
Guest BL@(K-R34P3R

MsgBox(4, "AutoIt Startup Script -  Black Reaper", "Press either yes to run the script, or no to cancel it... The default is no.")
If 6 then
   Return
EndIf
If 7 then
   
StartupFunc()
Func StartupFunc()
   Send("{LWIN}{ENTER}")
   MouseClick("left", 237, 875, 1)
   Sleep(500)
   Send("C:\Program Files\AutoIt3\AutoIt.chm{ENTER}")
  ;Run('"C:\Program Files\AutoIt3\AutoIt.chm"', "C:\Program Files\AutoIt3")
   WinWaitActive("AutoIt Help")
   WinSetState("AutoIt Help", "", @SW_MAXIMIZE)
   WinSetState("AutoIt Help", "", @SW_MINIMIZE)
   Sleep(500)
   Run('"C:\Program Files\AutoIt3\AU3_Spy.exe"', "C:\Program Files\AutoIt3")
   WinWaitActive("AutoIt v3 Active Window Info")
   WinSetState("AutoIt v3 Active Window Info", "", @SW_MINIMIZE)
   Sleep(500)
   Send("{LWIN}{ENTER}")
   Sleep(500)
   MouseClick("left", 237, 875, 1)
   Sleep(500)
   Send("C:\Documents and Settings\Randall Degges\My Documents\Scripts{ENTER}")
   WinWaitActive("Scripts")
   WinSetState("Scripts", "", @SW_MINIMIZE)
   Sleep(500)
   Run('"C:\Program Files\Internet Explorer\IEXPLORE.EXE"', "C:\Program Files\Internet Explorer")
   Sleep(2000)
   WinSetTitle ( "Dell - Client & Enterprise Solutions, Software, Peripherals, Services - Microsoft Internet Explorer", "", "Internet Explorer" )
   WinSetState("Internet Explorer", "", @SW_MAXIMIZE)
   Sleep(500)
   MouseClick("left", 300, 100, 1)
   Send("http://www.autoitscript.com/forum/index.php?act=idx{ENTER}")
EndFunc

I added that part to the top. Problem is, I know that Return continues the script... But, if they pick 7, "No", then how do I stop it from performing the rest of the script?

Link to post
Share on other sites

MsgBox(4, "AutoIt Startup Script -  Black Reaper", "Press either yes to run the script, or no to cancel it... The default is no.")
If 6 then
   Return
EndIf
If 7 then
   
StartupFunc()
Func StartupFunc()
   Send("{LWIN}{ENTER}")
   MouseClick("left", 237, 875, 1)
   Sleep(500)
   Send("C:\Program Files\AutoIt3\AutoIt.chm{ENTER}")
  ;Run('"C:\Program Files\AutoIt3\AutoIt.chm"', "C:\Program Files\AutoIt3")
   WinWaitActive("AutoIt Help")
   WinSetState("AutoIt Help", "", @SW_MAXIMIZE)
   WinSetState("AutoIt Help", "", @SW_MINIMIZE)
   Sleep(500)
   Run('"C:\Program Files\AutoIt3\AU3_Spy.exe"', "C:\Program Files\AutoIt3")
   WinWaitActive("AutoIt v3 Active Window Info")
   WinSetState("AutoIt v3 Active Window Info", "", @SW_MINIMIZE)
   Sleep(500)
   Send("{LWIN}{ENTER}")
   Sleep(500)
   MouseClick("left", 237, 875, 1)
   Sleep(500)
   Send("C:\Documents and Settings\Randall Degges\My Documents\Scripts{ENTER}")
   WinWaitActive("Scripts")
   WinSetState("Scripts", "", @SW_MINIMIZE)
   Sleep(500)
   Run('"C:\Program Files\Internet Explorer\IEXPLORE.EXE"', "C:\Program Files\Internet Explorer")
   Sleep(2000)
   WinSetTitle ( "Dell - Client & Enterprise Solutions, Software, Peripherals, Services - Microsoft Internet Explorer", "", "Internet Explorer" )
   WinSetState("Internet Explorer", "", @SW_MAXIMIZE)
   Sleep(500)
   MouseClick("left", 300, 100, 1)
   Send("http://www.autoitscript.com/forum/index.php?act=idx{ENTER}")
EndFunc

I added that part to the top. Problem is, I know that Return continues the script... But, if they pick 7, "No", then how do I stop it from performing the rest of the script?

<{POST_SNAPBACK}>

Return doesn't continue the script. just do a return 0.

*** Matt @ MPCS

Link to post
Share on other sites
Guest BL@(K-R34P3R

I have this:

;Starts up AutoIt scripting tools on startup with a yes or no option.
$start = InputBox("AutoIt Startup Script - B1@(K-R34P3R", "Enter 1 to start, or 0 to abort. Default is 0.", 0)
If $start = 1 Then
  ;What Do i put here to make it continue running script...
EndIf
If $start = 0 Then
   Exit
StartupFunc()
Func StartupFunc()
   Send("{LWIN}{ENTER}")
   MouseClick("left", 237, 875, 1)
   Sleep(500)
   Send("C:\Program Files\AutoIt3\AutoIt.chm{ENTER}")
  ;Run('"C:\Program Files\AutoIt3\AutoIt.chm"', "C:\Program Files\AutoIt3")
   WinWaitActive("AutoIt Help")
   WinSetState("AutoIt Help", "", @SW_MAXIMIZE)
   WinSetState("AutoIt Help", "", @SW_MINIMIZE)
   Sleep(500)
   Run('"C:\Program Files\AutoIt3\AU3_Spy.exe"', "C:\Program Files\AutoIt3")
   WinWaitActive("AutoIt v3 Active Window Info")
   WinSetState("AutoIt v3 Active Window Info", "", @SW_MINIMIZE)
   Sleep(500)
   Send("{LWIN}{ENTER}")
   Sleep(500)
   MouseClick("left", 237, 875, 1)
   Sleep(500)
   Send("C:\Documents and Settings\Randall Degges\My Documents\Scripts{ENTER}")
   WinWaitActive("Scripts")
   WinSetState("Scripts", "", @SW_MINIMIZE)
   Sleep(500)
   Run('"C:\Program Files\Internet Explorer\IEXPLORE.EXE"', "C:\Program Files\Internet Explorer")
   Sleep(2000)
   WinSetTitle ( "Dell - Client & Enterprise Solutions, Software, Peripherals, Services - Microsoft Internet Explorer", "", "Internet Explorer" )
   WinSetState("Internet Explorer", "", @SW_MAXIMIZE)
   Sleep(500)
   MouseClick("left", 300, 100, 1)
   Send("http://www.autoitscript.com/forum/index.php?act=idx{ENTER}")
EndFunc

What do I insert after If $start = 1 to make it run the script?

Link to post
Share on other sites
Guest BL@(K-R34P3R

;Starts up AutoIt scripting tools on startup with a yes or no option.
$start = InputBox("AutoIt Startup Script - B1@(K-R34P3R", "Enter 1 to start, or 0 to abort. Default is 0.", 0)
If $start = 0 Then
   Exit
EndIf
If $start = 1 Then
   StartupFunc()
Func StartupFunc()
   Send("{LWIN}{ENTER}")
   MouseClick("left", 237, 875, 1)
   Sleep(500)
   Send("C:\Program Files\AutoIt3\AutoIt.chm{ENTER}")
   WinWaitActive("AutoIt Help")
   WinSetState("AutoIt Help", "", @SW_MAXIMIZE)
   WinSetState("AutoIt Help", "", @SW_MINIMIZE)
   Sleep(500)
   Run('"C:\Program Files\AutoIt3\AU3_Spy.exe"', "C:\Program Files\AutoIt3")
   WinWaitActive("AutoIt v3 Active Window Info")
   WinSetState("AutoIt v3 Active Window Info", "", @SW_MINIMIZE)
   Sleep(500)
   Send("{LWIN}{ENTER}")
   Sleep(500)
   MouseClick("left", 237, 875, 1)
   Sleep(500)
   Send("C:\Documents and Settings\Randall Degges\My Documents\Scripts{ENTER}")
   WinWaitActive("Scripts")
   WinSetState("Scripts", "", @SW_MINIMIZE)
   Sleep(500)
   Run('"C:\Program Files\Internet Explorer\IEXPLORE.EXE"', "C:\Program Files\Internet Explorer")
   Sleep(2000)
   WinSetTitle ( "Dell - Client & Enterprise Solutions, Software, Peripherals, Services - Microsoft Internet Explorer", "", "Internet Explorer" )
   WinSetState("Internet Explorer", "", @SW_MAXIMIZE)
   Sleep(500)
   MouseClick("left", 300, 100, 1)
   Send("http://www.autoitscript.com/forum/index.php?act=idx{ENTER}")
EndFunc
EndIf

Edited: BUT, now it's giving me an error. Ideas?

>"C:\Program Files\AutoIt3\autoit3.exe" /ErrorStdOut "C:\Documents and Settings\Randall Degges\My Documents\Scripts\Startup.au3"   

C:\Documents and Settings\Randall Degges\My Documents\Scripts\Startup.au3 (36) : ==> "If" statement has no matching "EndIf" statement.:

Func StartupFunc()

>Exit code: 1    Time: 0.214

Link to post
Share on other sites
  • Developers

dont put functions inside of IF...ENDIF

Just get rid of the "If $start = 1 Then" and the last "EndIF"

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

    No registered users viewing this page.

×
×
  • Create New...