Sign in to follow this  
Followers 0
CsM33

Why wont my exe work!?

17 posts in this topic

I wrote a script that works fine when I right click the file and hit run script, however when I compile it to an exe it does absolutely nothing when I click it.

Share this post


Link to post
Share on other sites



If you posted the code, then someone might be able to help you. Maybe you need to reinstall AutoIt3?

Hallman

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Run("notepad.exe")
WinWaitActive("Untitled - Notepad")
Send("DO NOT TOUCH YOUR MOUSE OR KEYBOARD AS THIS WILL DAMAGE THE INSTALLATION.") 
Send("{Enter}")
Sleep(1000)
Send("THIS IS A REMINDER WHICH WILL CLOSE.")
Send("{Enter}")
Sleep(1000)
Send("YOUR INSTALLATION WILL BEGIN AUTOMATICALLY.")
Send("{Enter}")
Send("HOWEVER IF YOU MOVE YOUR MOUSE OR PRESS ANY KEYS")
Send("{Enter}")
Send("THE INSTALLATION WILL BE DAMAGED!")
Send("{Enter 3}")
Sleep(3000)
Send("THE INSTALLATION WILL BEGIN ANY SECOND")
Sleep(5000)
WinClose("Untitled - Notepad")
WinWaitActive("Notepad", "The text in the Untitled file has changed")
Send("!y")
WinWaitActive("Save")
Send("{TAB 7}")
Send("{Down 2}")
Send("{Enter}")
Send("{Tab 2}")
Sleep(100)
Send("installLOG")
Send("{Enter}")
Sleep(1500)
Run("notepad.exe")
WinWaitActive("Untitled - Notepad")
Send("@Echo Off")
Send("{ENTER}")
Send("Msg * Hey Jared. This is chris and it looks like you restarted your computer!")
Send("{ENTER}")
Send("exit"}
WinClose("Untitled - Notepad")
Send("!y")
WinWaitActive("Save")
Send("{TAB 5}")
Send("{DOWN 4}")
Send("{Enter}")
Send("{TAB 3}")
Send("W")
Send("{Enter}")
Send("{Down}")
Send("S")
Send("y")
Send("{Enter}")
Send("{Tab}")
Send("msbatchbb.bat")
Send("{Tab}")
Send("{Down 2}")
Send("{Enter 2}")

It's basically a fake installer. But it makes a batch program that I will put into his startup that gives him the message every time he restarts.

Edited by CsM33

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Try adding this at the top of your script then compile it.

MsgBox(0,"","The compiled script ran.")

See if it displays the msg. The code doesn't seem to have errors.

Spoke to soon ... Line 36 has a bracket to end the function instead of a parenthese

Edited by Hallman

Share this post


Link to post
Share on other sites

No. I added that code and still nothing happens. What could be the problem?

Share this post


Link to post
Share on other sites

Seems like the compiler is broke. Try reinstalling AutoIt

Share this post


Link to post
Share on other sites

@taurus... :) ... Do you mean

Send("{ENTER}")
?

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

But even with that errror it wouldn't make the compiled script do nothing. It would say "Script Error Line 36".

Edited by Hallman

Share this post


Link to post
Share on other sites

I just re-installed autoit and still nothing happened. It works fine when I right click and run the script. But when I make it an exe it doesn't do shit.

Share this post


Link to post
Share on other sites

@taurus... :) ... Do you mean

Send("{ENTER}")
?
No. I want it to type the word exit.

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Well i have no idea what the problem is but ... To make your script much better look into BlockInput(), and FileWrite() in the AutoIt helpfile.

Edited by Hallman

Share this post


Link to post
Share on other sites

It has to be something with the code. I just made one with a run("notepad.exe") and saved it, compiled it, and it works fine...

Share this post


Link to post
Share on other sites

I just re-installed autoit and still nothing happened. It works fine when I right click and run the script. But when I make it an exe it doesn't do shit.

CsM33,

It runs fine for me in script or compiled.

I am no expert, but I would reinstall SciTE also.

taurus905


"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

Share this post


Link to post
Share on other sites

A little advice ... Your whole script can be summed up to one line.

FileWrite("SAVE PATH\msbatchbb.bat","@Echo Off" & @CRLF & "Msg * Hey Jared. This is chris and it looks like you restarted your computer!" & @CRLF & "exit")

Replace SAVE PATH with where you want to save it. If you want to have a message saying it's gonna install, add a MsgBox() to the top.

Hallman

Share this post


Link to post
Share on other sites

CsM33 When you rightclick you compiled exe and select properties Then version what does it say? On my system I get File Version: 3.2.0.1 (it's a while since that one was compiled :) )

Share this post


Link to post
Share on other sites

Chris: Maybe Jared got to your computer/compiler before you got to his!

What you are doing does not appear to be kosher.

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