mercredi 17 juin 2015

My batch files if else statement isn't working

So I have created a file that works and when testing it without the if/else statement. When I put in this in a if statement it doesn't work at all though, is my syntax wrong or what? Thanks.

@echo off
set /p id= Folder Name:
set /p yn= Subfolders? (y/n):

If %yn% == "y"
Set rootDirectory = Y:\
md %id

Set rootDirectory = Y:\%id%
md %id%\Source
md %id%\Work
md %id%\PrintFinal

%SystemRoot%\explorer.exe %id%

Else
Set rootDirectory = Y:\
md %id%

%SystemRoot%\explorer.exe %id%

Aucun commentaire:

Enregistrer un commentaire