Hi all,
I have written a code in DOS. The program is to find a file in a location and print "File exists" if it is present.
Assume a file named test.txt exists in location D:\
In my sys I have enabled the option in xp-explorer
"Tools->Folderoptions->View->Hide extension for known file types". So if I search for the file with extension test.txt the code is working fine. Where as if i disenable the option the code cannot find the file.
Since I need to run the code in different machines, i need to search for a particular file, regardless of whether the option is enabled or not.
even if i am using "test" for search the code is not locating the file
here is the code:
cd D:\
if exist test.txt (
echo FILE EXISTS
) else (
if exist test (
echo FILE EXISTS
) else (
echo FILE doesn't exists
)
)
Thanks in advance