Sign in to follow this  
Followers 0
bobheart

Umm I Ren This Dircopy("c:\my Documents", "c:\back

8 posts in this topic

i ran this

DirCopy("C:\My Documents", "C:\Backups\MyDocs", 1)

And it made the folder but didn't copy anything over to the new folder ?

Then I was reading this .

DirMove("C:\My Documents", "C:\Backups\MyDocs")

But I saw this and kind of scared me to use it .

If the source and destination are on different volumes or UNC paths are used then a copy/delete operation will be performed rather than a move.

If the destination already exists and the overwrite flag is specified then the source directory will be moved inside the destination.

Didn't want to run it if it was going to delete anything ?

So what do I use to move files and folders too ?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Ok what it did was made a My Documents folder in C drive and made the other folder i must not have the right path . man that scared the crap out of me when I found that My doc and nothing in it ..

Is this right as it is not doing anything for me ?

DirCopy(@DesktopCommonDir & "\Desktop", "E:\New Folder", 1)

Just trying to get this @ to work and not have to use the full path .

Edited by bobheart

Share this post


Link to post
Share on other sites

This is the number I have on the help file 5.2.3735.0 and thanks for the help .

Share this post


Link to post
Share on other sites

Just got this when I tried it with yours .

---------------------------

AutoIt Error

---------------------------

Line 21 (File "E:\Programs\AutoIt3\Examples\English\newer scripts\may_20\Candles_backup_tool.au3"):

FileMove("@DesktopCommonDir & "\Desktop\*.*", "E:\New Folder")

FileMove("@DesktopCommonDir & "^ ERROR

Error: Unable to parse line.

---------------------------

Share this post


Link to post
Share on other sites

Remove the " before @DesktopCommonDir as:

FileMove(@DesktopCommonDir & "\Desktop\*.*", "E:\New Folder")

Share this post


Link to post
Share on other sites

For some reson I can't get that to work but the c: blah path works ?

I have this code .

I have a progress bar window but I can only get it to run when it is done or if I move it under the button it runs first then it moves file ?

;Generated with AutoBuilder 0.3

Opt("GUICoordMode", 1)
Opt("GUINotifyMode", 1)

GuiCreate("MyGUI", 331,201,10,10,0x04CF0000)
$label_1 = GUISetControl("label", "Candles Backup Tool", 20,10, 150,20)
$button_1 = GUISetControl("button", "Back Up Now", 120,160, 150,20)

GuiShow()

While 1
    sleep(100)
    $msg = GuiMsg(0)
    Select
    Case $msg = -3
  Exit
    Case $msg = $label_1
    ;;;
    Case $msg = $button_1
    ProgressOn("Progress Meter", "Increments every second", "0 percent")
For $i = 10 to 100 step 10
    sleep(1000)
    ProgressSet( $i, $i & " percent")
Next
ProgressSet(100 , "Done", "Complete")
sleep(500)
ProgressOff()
;;DirCopy(@FavoritesDir & "\Favorites\*.*", "E:\New Folder")
    DirCopy("C:\Clean", "E:\New Folder", 1)
    ;;;
    EndSelect
WEnd
Exit

Share this post


Link to post
Share on other sites

For some reson I can't get that to work but the c:  blah path works ?

One thing you should note is that @DesktopCommonDir already includes the subfolder /DESKTOP, so that:

@DesktopCommonDir & "\Desktop\*.*

would really mean:

C:\Documents and Settings\All Users\Desktop\Desktop

So you may be pointing to a nonexistent /desktop subfolder under /desktop.

About your script, it is written in a way that your progress bar will finish before executing the dircopy function.

You can probably do it this way:

1. count the number of files under c:\clean and its subdirectories (probably using filefindfirstfile and filefindnextfile)

2. loop until all files are moved:

2a. move a file

2b. update the progress bar percentage

2c. back to 2

3. endloop

I'm sure others will come up with a simpler way, but that's how I would do it with my limited knowledge.

Hope this helps.

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