![]() If we open Differences.txt, assuming there were in fact differences between FolderAcontents.txt and FolderBcontents.txt, we’ll see a summary of which files exist in FolderA that don’t in FolderB, and vice versa. We used the redirect operator (‘>’) to put the results in a file called Differences.txt. The “fc” command takes in our two files, and lists the differences between the two files. To create a file that summarizes the differences between our two text files, type the command:įc FolderAcontents.txt FolderBcontents.txt > Differences.txt.We’ll now look at how to compare these two text files. ![]() We now have two text files that each list the files within their respective targeted folders: FolderAcontents.txt lists FolderA’s files, and FolderBcontents.txt lists FolderB’s files. To create the file that lists FolderB’s contents, type:.Let’s generate a file that lists FolderB’s contents now. NOTE: To see other options that the dir command can use, use the command “dir /?”. If the indicated file the results are being redirected to does not exist, cmd will create it. NOTE: FolderAcontents.txt did not need to exist prior to running the command. We used the ‘/b’ option, the folder name (FolderA), and the redirect to a file syntax, all in the same command. The command “dir > filename” puts the results of running the dir command in a text file, instead of inside the cmd window. The command “dir /b” uses the ‘/b’ option which lists the file and folder names, without the additional information such as date, time, and file size. The command “dir FolderA” lists the contents of FolderA, without first changing directory (cd command) to that folder. This time, we are adding a few more options to the dir command. We used the dir command in the last step in order to simply list all of the files in the current directory. ![]() To create a text document that lists all of the files of a folder, type:.The first thing we’ll do is generate a text document for each folder that lists all of its files. Let’s learn how to compare the folders now. For the sake of this tutorial, we will assume that you do. If you do indeed have a FolderA and FolderB there, you should seem them listed. ![]() You should see a listing of the files and folders on the Desktop.
0 Comments
Leave a Reply. |