Sign in to follow this  
Followers 0
Rewl

Backing-Up Code

6 posts in this topic

My code isn't working, syntax is correct but when ever I run it to test it, it doesn't work.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
HotKeySet("{ESC}" , "close")
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Back-Up by Rewl", 393, 288, 192, 124)
Global $Button1 = GUICtrlCreateButton("Backup to H:/", 120, 16, 131, 57, $WS_GROUP)
Global $Checkbox1 = GUICtrlCreateCheckbox("Favorites", 16, 96, 97, 17)
Global $Checkbox2 = GUICtrlCreateCheckbox("Desktop", 16, 120, 97, 17)
Global $Checkbox3 = GUICtrlCreateCheckbox("Music", 16, 144, 97, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Do
    $msg = GUIGetMsg()
    If $msg = $Button1 Then
        DirCreate("H:\Back Up")
        If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then ConsoleWrite ( "DirCopy Favorites " & @Crlf )
        If GUICtrlRead($Checkbox2) = $GUI_CHECKED Then ConsoleWrite ( "DirCopy Desktop " & @CRLF )
        If GUICtrlRead($Checkbox3) = $GUI_CHECKED Then ConsoleWrite ( "DirCopy Music " & @Crlf )
        MsgBox(0 , "Back-Up Complete" , "Your files have been backed up.")
    EndIf
Until $msg = $GUI_EVENT_CLOSE

Func close()
    MsgBox(0, "Back-Up by Rewl" , "Thank you for using Back-Up by Rewl")
    Exit
    EndFunc

[size="1"]Programs: Draw Tool | [/size]

Share this post


Link to post
Share on other sites



What do you mean by "doesn't work."?

I tested the code and it does what it is supposed to do: Write Text to the Console or to a MsgBox.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

It seems to do just what it ought to...

It displays messages on the console, depending on which boxes are checked.

Wherein lies the problem?

Share this post


Link to post
Share on other sites

it doesn't back up the files when you press backup


[size="1"]Programs: Draw Tool | [/size]

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

It can't do any backups because there is no backup code in your script. It only creates a directory.

I think you should remove the ConsoleWrite statements and replace them with Dircopy commands.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

So what code would be used to make it "compile" and than be moved


[size="1"]Programs: Draw Tool | [/size]

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