Windows 10

Batch File To Check If Folder Exists

In this tutorial, we are going to see how to check if folder exists in a batch file by using IF EXIST condition. Batch file contains a series of DOS (Disk Operating System) instructions. It allows triggering the execution of commands found in this file.
 

Batch File To Check If Folder Exists

The following example check if the folder “C:\Users\StackHowTo\myFolders” exists:

@echo off

if exist "C:\Users\StackHowTo\myFolders" (
  echo Exist 
) else (
  echo Does not exist
)

Output:

Exist

Leave a Reply

Your email address will not be published. Required fields are marked *