Solved fc and find functions in a batch file

March 7, 2016 at 11:23:56
Specs: Windows 10
I have to make a batch file which contains file compare and file finding functions. How can I make it?

See More: fc and find functions in a batch file

Report •


#1
March 7, 2016 at 14:30:56
✔ Best Answer
firstfile.txt--
I think this is homework

secondfile.txt--
I know this is homework
I think this is homework

batchfile.bat--
@echo off
fc firstfile.txt secondfile.txt | find "homework"

are you trying to find something in a file or files in a directory

::mike

message edited by mikelinus


Report •

#2
March 7, 2016 at 21:04:17
The old norton utilities for dos had a File Find and maybe a file compare. Dos had a file compare.

A batch file is just a series of dos commands in a single file so if you understand those commands it shouldn't be a problem putting them in a batch file.


Report •

#3
March 8, 2016 at 10:38:50
I'm trying to find a file in directory

Report •

Related Solutions

#4
March 8, 2016 at 19:55:50
DIR/S C:\filename

and enter from the dos prompt will find the file named filename on the C: drive by searching all the subdirectories.

I take it you're not all that familiar with dos?


Report •

#5
March 10, 2016 at 07:44:17
if exist "c:\filename.txt" echo filename.txt found

echo string can be replaced with other commands.

would be an easy way to see if there is a file named something in a certain directory.

::mike


Report •


Ask Question