darknrahl

Autoit Exe help

6 posts in this topic

Hello Folks,

I am new to autoit and finding some difficulties. The problem is, Say i have an already compiles gui(exe). How do i make such gui create and exe file that is  executable. I've run out of ideas on how it can be done. For example, I have a gui that takes a user input in the form of a filename then echo it out with the standard msgbox. This time i want to accept user input and store the file as an exe which when executed popups up a msg box. this is my sample code:

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.14.0
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <File.au3>

 

Opt("GUIOnEventMode", 1)


#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Exe Creater", 343, 176, 192, 124)
$Label1 = GUICtrlCreateLabel("Exe Creater", 104, 8, 136, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("This program creates an exe that outputs a msgbox.", 16, 40, 248, 17)
$Input1 = GUICtrlCreateInput("msgbox", 16, 80, 313, 21)
$Button1 = GUICtrlCreateButton("Create Exe", 128, 128, 75, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

GUISetOnEvent($GUI_EVENT_CLOSE, "closeprog")

GUICtrlSetOnEvent($Button1, "createprog")

While 1
    Sleep(100)
WEnd

Func closeprog()
    Exit
EndFunc

Func createprog()
    Local $Input1hld = GUICtrlRead($Input1)
    Local $fileloc = $Input1hld &".exe"
    Local $echoing = MsgBox(0, "File Successfully Created", "File name is : " & $fileloc)

    _FileCreate ( $fileloc )

    FileWrite($fileloc, $echoing)
    EndFunc

 

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Have a look at this post: Link

P.S. Welcome to the AutoIt forum @darknrahl^_^

Edited by MikahS

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Share this post


Link to post
Share on other sites

darknrahl,

Can you clarify this...

store the file as an exe

kylomas

 


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

@kylomas When i say store the file as exe, i mean accept the user input, then make the results an exe file which when clicked on or executed gives the results. So basically, i want my gui to accept the user input, craete an exe file in the current dir which show the results in a message box when clicked.

 

@MikahS read it but i dont want to call another script. All i want is my standalone compiled gui accepting an input and then creating an exe file with processed input, which when clicked on displays results in a msgbox

Edited by darknrahl

Share this post


Link to post
Share on other sites

@Jos

I looking forward to writing a simple server and client program. I am wondering, instead of creating a server part and a client part, why not just one executable(client) that creates a server . exe 

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