File Compare (fc.exe) error - no such file or folder

M

michaeljnc

Recently I have encountered a problem with the fc command.
I have used this successfully for years.

If I enter:

fc /l c:\bat1\aurbk2.bat c:\batxp\aurbk2.bat
OR
fc c:\bat1\aurbk2.bat c:\batxp\aurbk2.bat

I get the following error:

FC: cannot open C:\BAT1\AURBK2.BAT - No such file or folder

Both files clearly exist.
On checking the file attributes, I found that the file had none.
When I added the Archive attribute to the file, the fc compare
worked.

Can someone tell me why this is happening and how can I
prevent the Archive attribute from being removed during
regular file edits and copying (assuming that the missing attribute
is causing the problem).

Thanks,
mjc
 
P

Pegasus

michaeljnc said:
Recently I have encountered a problem with the fc command.
I have used this successfully for years.

If I enter:

fc /l c:\bat1\aurbk2.bat c:\batxp\aurbk2.bat
OR
fc c:\bat1\aurbk2.bat c:\batxp\aurbk2.bat

I get the following error:

FC: cannot open C:\BAT1\AURBK2.BAT - No such file or folder

Both files clearly exist.
On checking the file attributes, I found that the file had none.
When I added the Archive attribute to the file, the fc compare worked.

Can someone tell me why this is happening and how can I
prevent the Archive attribute from being removed during
regular file edits and copying (assuming that the missing attribute
is causing the problem).

Thanks,
mjc

Your comment is at variance with my own observations.
I suggest you run this batch file in order to get tightly
controlled test conditions:

@echo off
echo This is file 1 > c:\File1.txt
echo This is file 2 > c:\File2.txt
echo %date% %time% > c:\test.txt
dir c:\File*.txt >> c:\test.txt
attrib -a c:\File2.txt >> c:\test.txt
attrib c:\File*.txt 1>> c:\test.txt 2>>&1
fc c:\File1.txt c:\File2.txt 1>> c:\test.txt 2>>&1
notepad c:\test.txt

Now paste the contents of c:\test.txt into your reply.
 
M

michaeljnc

Sun 06/10/2007 13:51:09.45
Volume in drive C has no label.
Volume Serial Number is 74A8-2751

Directory of c:\

06/10/2007 01:51 PM 17 File1.txt
06/10/2007 01:51 PM 17 File2.txt
2 File(s) 34 bytes
0 Dir(s) 120,368,029,696 bytes free
A C:\File1.txt
C:\File2.txt
Comparing files C:\File1.txt and C:\FILE2.TXT
***** C:\File1.txt
This is file 1
***** C:\FILE2.TXT
This is file 2
*****

Yes, it appears to have worked properly, nevertheless,
adding the A attribute did work as I reported.
So I still don't understand why it failed before.

This is a bit off topic, but I'm not familiar with this syntax:

attrib c:\File*.txt 1>> c:\test.txt 2>>&1
fc c:\File1.txt c:\File2.txt 1>> c:\test.txt 2>>&1

particularly the added 1 and 2 and the &1
 
P

Pegasus

michaeljnc said:
Sun 06/10/2007 13:51:09.45
Volume in drive C has no label.
Volume Serial Number is 74A8-2751

Directory of c:\

06/10/2007 01:51 PM 17 File1.txt
06/10/2007 01:51 PM 17 File2.txt
2 File(s) 34 bytes
0 Dir(s) 120,368,029,696 bytes free
A C:\File1.txt
C:\File2.txt
Comparing files C:\File1.txt and C:\FILE2.TXT
***** C:\File1.txt
This is file 1
***** C:\FILE2.TXT
This is file 2
*****

Yes, it appears to have worked properly, nevertheless,
adding the A attribute did work as I reported.
So I still don't understand why it failed before.

This is a bit off topic, but I'm not familiar with this syntax:

attrib c:\File*.txt 1>> c:\test.txt 2>>&1
fc c:\File1.txt c:\File2.txt 1>> c:\test.txt 2>>&1

particularly the added 1 and 2 and the &1

Your task is now to find out why your commands failed in your
first attempt and why they worked when you used my recipe.
I can see several possibilities:
- Your observations were inaccurate.
- You ran different commands than the ones you reported in your post.
- There is something badly wrong with the folder you originally used.

About your second question:
"1>> c:\test.txt" will direct standard command output to c:\test.txt
"2>> c:\test.txt" will direct error command output to c:\test.txt
"2>>&1" will direct error output to the device already defined for standard
output.
 
M

michaeljnc

Pegasus said:
Your task is now to find out why your commands failed in your
first attempt and why they worked when you used my recipe.
I can see several possibilities:
- Your observations were inaccurate.
- You ran different commands than the ones you reported in your
post. - There is something badly wrong with the folder you
originally used.

I copied the commands as I had typed them.
They were still visible in the command window.
Also, I copied the error exactly as it was shown.
I did verify that the file was at least visible using
the DIR command. As for the rest, I can't say.
I just ran a disk error-check on restart, but the
results are only visible for about 1 second, so
I could not see if any problems were reported.
Changing the attribute was just a shot in the dark.
When I saw the 'A' missing with an attrib listing,
I added that attribute just to see what would happen.
Maybe there was some other variable involved that
I am not aware of.

Thanks for your help.
mjc
 
R

Rock

I just ran a disk error-check on restart, but the
results are only visible for about 1 second, so
I could not see if any problems were reported.

<snip>

For the results of chkdsk look in the Application log in Event Viewer for a
Winlogon entry.
 
M

michaeljnc

Rock said:
<snip>

For the results of chkdsk look in the Application log in Event
Viewer for a Winlogon entry.

A disk check has been scheduled.

Windows will now check the disk.

Cleaning up 43 unused index entries from index $SII of file 0x9.

Cleaning up 43 unused index entries from index $SDH of file 0x9.

Cleaning up 43 unused security descriptors.

156167864 KB total disk space.

38373296 KB in 89006 files.

28168 KB in 8194 indexes.

0 KB in bad sectors.

181448 KB in use by the system.

65536 KB occupied by the log file.

117584952 KB available on disk.

4096 bytes in each allocation unit.

39041966 total allocation units on disk.

29396238 allocation units available on disk.
 
M

michaeljnc

Rock said:
For the results of chkdsk look in the Application log in Event
Viewer for a Winlogon entry.

Another premature 'send' (previous post) when I used Ctrl+Enter
to insert a new line.

Wish I had a dollar for every time I've done that!
mjc
 
R

Rock

michaeljnc said:
A disk check has been scheduled.

Windows will now check the disk.

Cleaning up 43 unused index entries from index $SII of file 0x9.

Cleaning up 43 unused index entries from index $SDH of file 0x9.

Cleaning up 43 unused security descriptors.

156167864 KB total disk space.

38373296 KB in 89006 files.

28168 KB in 8194 indexes.

0 KB in bad sectors.

181448 KB in use by the system.

65536 KB occupied by the log file.

117584952 KB available on disk.

4096 bytes in each allocation unit.

39041966 total allocation units on disk.

29396238 allocation units available on disk.


Those are normally occurring, minor problems
 
R

Rock

michaeljnc said:
Another premature 'send' (previous post) when I used Ctrl+Enter
to insert a new line.

Wish I had a dollar for every time I've done that!
mjc

Lol.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top