Need help with an IF Then ElseIf Else statement in windows batch file.
Posted on 2007-03-30
I have a batch file that maps various network drives. The bat file is the same on all computers, however, I would like the drive that gets mapped to be different if a certain file exists. For example, I want to write into my .bat file to check and see if "c:\file1.dat" exists. If so, map drive x to 220.127.116.11\c$, elseif "c:\file2.dat" exists map to 18.104.22.168\d$, else map to 22.214.171.124\e$. I can do this fine with VBScript but just not in Windows Batch. So basically a simple if/then elseif, else statement. Thanks in advance!