Sign in to follow this  
Followers 0
Canada369

N00b Help

3 posts in this topic

#1 ·  Posted (edited)

Well im amking a dir remover, i knw very n00b but its helping me learn :).

so far i got

;File Remover Version 1.0
;By Canada369


#include <GuiConstants.au3>

If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

GuiCreate("File Remover Version 1.0 By Canada369", 387, 121,(@DesktopWidth-387)/2, (@DesktopHeight-121)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
GuiSetIcon(@SystemDir & "\cmd.exe", 0)

$input = GuiCtrlCreateInput("DIR to be deleted.", 10, 10, 370, 20)
$close = GuiCtrlCreateButton("Exit", 240, 80, 90, 30)
$delete = GuiCtrlCreateButton("Delete/Remove", 240, 40, 90, 30)

;$Checkbox_5 = GuiCtrlCreateCheckbox("Remove Subfolders?", 40, 50, 140, 50)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE Or $msg = $close
        ExitLoop
    Case $msg = $delete
                 DirRemove ( "$input" ,1 ); I tryed it wihout the quotes too.   
            
               
            
            EndSelect
WEnd
Exit

Now im having 1 main problem.

I cant get it to "remove" what the dir in the input box, what am i doing wrong?

p.s., ignore the ;checkbox its jsut there for now, im tyring to get it to work :evil:

Edited by Canada369

Share this post


Link to post
Share on other sites



Well im amking a dir remover, i knw very n00b but its helping me learn :).

so far i got

;File Remover Version 1.0
;By Canada369
#include <GuiConstants.au3>

If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

GuiCreate("File Remover Version 1.0 By Canada369", 387, 121,(@DesktopWidth-387)/2, (@DesktopHeight-121)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
GuiSetIcon(@SystemDir & "\cmd.exe", 0)

$input = GuiCtrlCreateInput("DIR to be deleted.", 10, 10, 370, 20)
$close = GuiCtrlCreateButton("Exit", 240, 80, 90, 30)
$delete = GuiCtrlCreateButton("Delete/Remove", 240, 40, 90, 30)

;$Checkbox_5 = GuiCtrlCreateCheckbox("Remove Subfolders?", 40, 50, 140, 50)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE Or $msg = $close
        ExitLoop
    Case $msg = $delete
                 DirRemove ( "$input" ,1 ); I tryed it wihout the quotes too.   
            
               
            
            EndSelect
WEnd
Exit

Now im having 1 main problem.

I cant get it to "remove" what the dir in the input box, what am i doing wrong?

p.s., ignore the ;checkbox its jsut there for now, im tyring to get it to work :evil:

<{POST_SNAPBACK}>

I don't know if you can remove a Directory with a variable, but it would go something like this if you could:

;By Canada369
#include <GuiConstants.au3>

If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

GuiCreate("File Remover Version 1.0 By Canada369", 387, 121,(@DesktopWidth-387)/2, (@DesktopHeight-121)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
GuiSetIcon(@SystemDir & "\cmd.exe", 0)

$input = GuiCtrlCreateInput("DIR to be deleted.", 10, 10, 370, 20)
$close = GuiCtrlCreateButton("Exit", 240, 80, 90, 30)
$delete = GuiCtrlCreateButton("Delete/Remove", 240, 40, 90, 30)

;$Checkbox_5 = GuiCtrlCreateCheckbox("Remove Subfolders?", 40, 50, 140, 50)

GuiSetState()
While 1
   $msg = GuiGetMsg()
   Select
      Case $msg = $GUI_EVENT_CLOSE Or $msg = $close
         ExitLoop
      Case $msg = $delete
         $DirRemove = GUICtrlRead($input); *** Reads Input Box and Stores in a Variable
         DirRemove ( $DirRemove ,1 ); I tryed it wihout the quotes too.
   EndSelect
WEnd

Hope this gives you ideas for this and future projects.


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.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

ok cool, let me test it.

BTW thx for replying so fast :)

EDIT

YYA IT WORKED, thanks.

Edited by Canada369

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