Sign in to follow this  
Followers 0
AcidCorps

edit box to cmd

3 posts in this topic

is there a way to create a cmd file with text entered in an edit box

so if in the edit box it says

Echo hi

Echo how are you?

the cmd file will be created with

Echo hi

Echo how are you?

as the lines in it

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi, do mean something like this as a crude example ?

#include <GUIConstants.au3>

$Gui = GuiCreate('Edit To CMD', 400, 300)
$Edit = GuiCtrlCreateEdit('', 10, 10, 380, 250)
$Button = GUICtrlCreateButton('Save', 175, 270, 50, 20)
GUISetState()

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Button
            $Buffer = GuiCtrlRead($Edit)
            $Save = FileSaveDialog('Save to..', @ScriptDir, 'CMD File (*.cmd)', 18, 'MyCmd.cmd')
            If @error <> 1 Then
                FileClose(FileWrite(FileOpen($Save, 2), $Buffer))
            EndIf
    EndSelect
Wend

Cheers

Edited by smashly

Share this post


Link to post
Share on other sites

thats enough information for me to get what I want.

Thank you

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