Jump to content

Backing-Up Code


Rewl
 Share

Recommended Posts

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]

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...