I am trying to make a .bat file that creates a simple text file. My problem is Windows XP home folder is C:\Documents and Settings while vista and above its C:\Users\
I am running this and no matter what I put for the path name, I always get it exists
@echo off
if exist C:\Documents and Settings\ (
echo it exists
Pause
) else (
echo file not found
Pause
)
When I run the above I get it exists when in fact it does not since I am windows 7. What am I doing wrong?
Firstly, you are missing quotes around the path. Second
EXISTonly checks if files exist. There are a few secret files Windows uses in its file system. Try the following: