ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

IDEA: MoveAllTo C:\olddata

<< < (2/2)

cthorpe:
What about XXcopy http://www.xxcopy.com/index.htm?
There is a free for personal use version.




--- ---XXCOPY  C:\  C:\OldData\   /CCY /H /S
That is, copy everything from C:\ to C:\OldData\ and deal with the cyclical issue that could arise (/CCY) and copy hidden/system files.

You could add


--- ---/RCY /S to the end to remove all copied files and subdirectories if you wanted.

moongoon:
Thanks to everyone for the responses.  However, no pre-made utility has worked adequately.  In an attempt to fire up the coding spirit I've attempted to make an AutoIt3 script to do the job.  It doesn't work but my hope is someone with actual programming skill will notice what is wrong.  It creates the C:\OldData folder, moves the root files to C:\OldData but none of the folders.  Take a look if you can :)


--- ---DirCreate("C:\OldData")
FileMove("C:\*.*", "C:\OldData",8)

; Shows the filenames of all files in the current directory
$search = FileFindFirstFile("C:\*.*") 

; Check if the search was successful
If $search = -1 Then
    MsgBox(0, "Error", "No files/directories matched the search pattern")
    Exit
EndIf

While 1
    $file = FileFindNextFile($search)
    If @error Then ExitLoop
If $file = "OldData" then $file = FileFindNextFile($search)
    If @error Then ExitLoop
DirMove( chr(34) & "C:\" & $file & chr(34), chr(34) & "C:\OldData\" & $file & chr(34), 1)
WEnd

; Close the search handle
FileClose($search)

mmdoogie:
When you physically move a folder from one location to another on the same partition,
there is a very simple operation that can be performed by Windows to effect the move,
and this is what Windows Explorer uses to make the quick change.

Making a copy, or moving to a different drive or partition causes Windows to have to physically access every file,
making it a long process, and giving it many more problems.

So, your problem definitely needs to be attacked in the Move domain to get similar results.
There is an AutoIt3 command for DirMove which moves a directory, similar to how a file is moved,
so I think you will have to get a list of the directories in C:\ and move them one by one.

My guess then would be do do a loop like the one you use to do the verification, but instead get a list of all the items in C:\
Then, run both DirMove and FileMove on each item -- one of them will return failure, but that should be ok, as the other will succeed.

--matthew

Navigation

[0] Message Index

[*] Previous page

Go to full version