IF NOT EXIST returns ERROR in output | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

IF NOT EXIST returns ERROR in output

Hello, lately I've been working on a small project in Batch, now I have a code that tests if a folder exists, if it does everything is fine, but if the statement "IF NOT EXIST" is true, it outputs an error (just says ERROR). It appears to happen after the code when I use the ECHO command no matter where. Here's the code: REM CREATE FOLDERNAME VARIABLE SET /P FOLDERNAME=WHAT IS THE NAME OF THE FOLDER WHERE THE UNORGANIZED FILES ARE LOCATED IN? REM FIND FOLDER IF NOT EXIST "D:\Users\Eldar\Desktop\%FOLDERNAME%\" ( ECHO ERROR! FOLDER "%FOLDERNAME%" WAS NOT FOUND! ) ELSE ECHO "%FOLDERNAME%" WAS FOUND PAUSE COLOR 0C ECHO ERROR! FOLDER "%FOLDERNAME%" WAS NOT FOUND! PAUSE>NUL

18th Aug 2017, 8:30 PM
Eldar Bakerman
4 Answers
0
Maybe in a few hours could do some test ;-)
21st Aug 2017, 1:39 PM
Daniel
Daniel - avatar
0
Have "a few hours" passed yet?
29th Aug 2017, 7:00 AM
Eldar Bakerman
0
of course, I forgot it. Please write to me danifdez79@hotmail.com to remember me
29th Aug 2017, 11:55 AM
Daniel
Daniel - avatar
0
Ok
29th Aug 2017, 12:55 PM
Eldar Bakerman