PowerBASIC Users Meeting Point
File Transfer Between PCs - Printable Version

+- PowerBASIC Users Meeting Point (http://pump.richheimer.de)
+-- Forum: User to User Discussions (http://pump.richheimer.de/forumdisplay.php?fid=3)
+--- Forum: PowerBASIC for Windows (http://pump.richheimer.de/forumdisplay.php?fid=4)
+--- Thread: File Transfer Between PCs (/showthread.php?tid=79)



File Transfer Between PCs - Gary Beene - 19.09.2025

I want to move all DOCX files from an old PC to my new PC, preferably by first putting them all on a flash drive which I use for the transfer.

I've posted code before that would capture a list of files anywhere on the PC that match a filespec such as "*.docx". I can use that to copy files to the flash.

But because some files have the same name, I can't just fill the root folder of the flash with all the files by their original name.  To do that I would have to rename files - such as with a simple prefix of "00001", "0002", etc.  Or, I could prefix the original folder name onto each file name, substituting the \ characters with an underscore.  That won't recreate the old folder structure on the new PC, but will at least capture all of the files.

Better yet, I could use something like Beyond Compare to find only DOCX files and replicate the original folder structure onto the new PC.  That's the most "exact" approach, but I'd have to be careful not to inappropriately overwrite any files on the new PC.

As best I know, the command line xcopy can do a similar thing but doesn't as easily et you pick and chose which files to copy.

Anyone use a better solution?


RE: File Transfer Between PCs - George Bleck - 19.09.2025

A flat copy without playing the renaming game you will always hit a wall. Using XCOPY/Robocopy adds it own challenges, especially with really long file paths and it putting files all over the place and source target folders not lining up on the source and target machines.

What you could try is get the 7zip command line version (7za.exe) and run this command...

  7za a -r <archive_name>.zip <path_to_start_search>\*.<extension>

This creates an archive in the location you specify, recursively looks from "start search" downwards, then adds the files matching the extention to the archive. The file names do not need to be renamed as the path is remembered in the archive. This also saves some space too.

SUPPORT ADVICE FROM A CAREER IT PERSON
DON'T just raw copy the data from location A to B, especially if it is all over the drive in sub-folders outside the User folder. If you are moving to a new PC, NOW is the time to slow down and do it right by properly following the locations Microsoft wants you to store data (e.g., in Documents). This way the next move is much smoother. I can't impress enough that THIS is the way it should be. I've had to support people with data all over the place for decades and it never works out well for them. Store it in Documents, life is a breeze. Storing the data anywhere else on the system drive is a recipe for later pain.

Yes it is your drive, yes you can store data anywhere you want it, but Microsoft and applications expect the data to be in Documents. Especially if the machine is shared, this prevents others from accessing data without permission. And yes there are folders for data meant to be shared.


RE: File Transfer Between PCs - Gary Beene - 20.09.2025

Howdy, George!

Thanks for the reply!

What you suggest is what I personally do (almost).  Every file of any type I create is in c:\data or one its subfolders. So copying files I have created to a new machine is very easy.

In helping a user whose files are already "all over the place", I'd like to avoid any sizable effort to co-locate the files ... such as when moving all DOCX files to Documents.  In some cases it might be pretty simple, but in other cases the legwork can be more effort than I want to volunteer.