darknrahl Posted July 21, 2015 Share Posted July 21, 2015 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)WEndFunc closeprog() ExitEndFuncFunc 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 Link to comment Share on other sites More sharing options...
MikahS Posted July 21, 2015 Share Posted July 21, 2015 (edited) Have a look at this post: LinkP.S. Welcome to the AutoIt forum @darknrahl! Edited July 21, 2015 by MikahS Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy 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 Link to comment Share on other sites More sharing options...
kylomas Posted July 21, 2015 Share Posted July 21, 2015 darknrahl,Can you clarify this...store the file as an exekylomas 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 Link to comment Share on other sites More sharing options...
darknrahl Posted July 21, 2015 Author Share Posted July 21, 2015 (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 July 21, 2015 by darknrahl Link to comment Share on other sites More sharing options...
Developers Jos Posted July 21, 2015 Developers Share Posted July 21, 2015 Really wondering why this would be something you want.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 More sharing options...
darknrahl Posted July 21, 2015 Author Share Posted July 21, 2015 @JosI 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now