Back to the Days of DOS

Nov 06, 2021 Last reply: 4 years ago 11 Replies

I used to know DOS pretty well. I am copying a lot of files to a flash drive for backup and need to verify what has been transferred by comparing directories. A simple count is sufficient. Trouble is I'm getting incomplete data.



I'm using a DIR command to a file, then examining the files to see how many files are missing. My text editor can do a diff if the counts don't match.



When I check the total number in the properties it is far more than the number I'm seeing in the DIR command. I can't understand why that is happening.



Anyone know of a limitation of the DIR command on the number of files reported in a given directory?



dir /b /on /s >dir.txt


Depends on the version IIRC. Early DOS versions had sharply limited number of entries in \, and maybe subdirectories as sell.

I used to really like DOS 3.3 BITD.

Cheers

Phil Hobbs

This isn't really DOS, it's Windows command. Hard to imagine they'd impose such a limitation.

I did a Google search on how to do this and someone posted a PowerShell script. I couldn't get it to work because a command was not present on my machine. It wasn't worth it to me to figure that out.

The files I've identified so far were virus infected .htm or .xlsx or similar files attached to emails. They get removed when copied to the flash drive, but I guess not from the original directory.

Rick C snipped-for-privacy@gmail.com wrote in news: snipped-for-privacy@googlegroups.com:

Wow. Boot a Linux live disc and use that.

As for DOS, you would not be able to have any long file names. And it may not even boot on some newer machines, even though they are X86.

There are switches in dir where you could bring up file lists like all files starting with "A", and then compare shorter lists. That might make the task more "doable" from DOS.

Or you could try the copy again, and all the files that are already existing could be skipped.

DR DOS would likely have better "utilities". I used to keep a DR DOS utility directory on my machine because they worked under MS DOS whithout the version mismatch crap.

If you ran a Linux session in Windows, which it does now, you could

Rick C snipped-for-privacy@gmail.com wrote in news: snipped-for-privacy@googlegroups.com:

You may get a different set of available commands in powershell if you do not run it in administrator mode.

Sadly it isn't hard to imagine them making that sort of mistake at all.

I prefer to do a CRC of every file on the destination against every file on the source. It has the advantage of verifying that the contents are (probably) the same in each place and readable too.

I have seen way too many unreadable backups where the directory entries all looked fine but the file contents themselves were scrambled.

Winmerge isn't too bad at comparing files and directories to find any differences between them (and it is free).

formatting link

The root had a limited number of entries (files or subdirectories) but subdirectories always had unlimited capacity because they are, themselves, files that can grow, as opposed to a fixed data structure like the root.

For DIR to include hidden and system files, add /a for attributes.

Also, use TeraCopy if doing the copy via the GUI, or XCOPY or Robocopy if using the CLI.

I'll give it a try. Free is my favorite type of freeware. I'll need to start over with the flash drive. I forgot to format it as an alternate format from the default FAT32, like exFAT for example. I always discover this when it won't copy files larger than 4 GB which is well into the process. That's ok, I've got time...

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required