windows - BATCH exist not working -
i've started making small program in batch, worked fine until i've gotten if not exist
, problems started every time got statement, batch file has crashed. here's code:
rem beggining options @echo off title organizer color 07 mode con cols=101 lines=30 setlocal enabledelayedexpansion cls rem welcome cls color e echo welcome organizer.bat! program made eldar bakerman organize files , computer! echo version 1.0! echo project started in 11.08.2017 (dd/mm/yyyy) echo press key continue pause>nul rem organization :organization color 0b cls rem create foldername variable set /p foldername=what name of folder unorganized files located in? rem find folder if not exist "d:\users\eldar\desktop\%foldername%\nul" ( color 0c echo error! folder "%foldername%" not found! pause>nul ) else ( pause ) pause
here's script without bloat:
@echo off set/p "foldername=what name of unorganized files folder? " if not exist "d:\users\eldar\desktop\%foldername%\" ( echo error! folder "%foldername%" not found! ) else echo "%foldername%" found pause
hopefully can see how parenthesis placement works.
Comments
Post a Comment