Sign in to follow this  
Followers 0
mastrboy

Convert Batch Script To Auto-it Gui

6 posts in this topic

#1 ·  Posted (edited)

-

Edited by mastrboy

 -

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

I don't understand exactly this batch file, but here is something to beginning :)

#include <GUIConstants.au3>
#Include <File.au3>

$Form1 = GUICreate("AForm1", 622, 441, 192, 125)
$Edit1 = GUICtrlCreateEdit("", 50, 42, 485, 333, -1, $WS_EX_CLIENTEDGE)
$btn1 = GUICtrlCreateButton("Action",250,400,100)
GUISetState(@SW_SHOW)

While 1
    $msg = GuiGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $btn1
            Action("C:\hummingbird\cache\")
    EndSelect
WEnd

Func Action($dir_name)
    $FileList=_FileListToArray($dir_name,"*.*",1)
    If @Error Then Return
    
    For $i = 1 to UBound($FileList) - 1
        $file_name = $FileList[$i]
        GUICtrlSetData ($Edit1, $file_name & @CRLF,1)
        FileDelete($dir_name & $file_name)
    Next

    DirRemove($dir_name,1)
    GUICtrlSetData ($Edit1, @CRLF & $dir_name & " deleted.",1)
EndFunc

Be carefull when using FileDelete(), DirRemove() ...

Edited by Zedna

Share this post


Link to post
Share on other sites

thanks i'll check it out


 -

Share this post


Link to post
Share on other sites

WOW.. Sorry for awakening an old post but just wanted to tell Zedna what a cool script that is. It helps me understand the workings behind the gui a little better.

Thanks a bunch.

Share this post


Link to post
Share on other sites

WOW.. Sorry for awakening an old post but just wanted to tell Zedna what a cool script that is. It helps me understand the workings behind the gui a little better.

Thanks a bunch.

Hi gesller

I hear your appreciation :(

I'm pleased to help somebody to give a right direction

Happy scripting in AutoIt :shocked:

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