File existence checks should use quotes in Windows (when the filename uses spaces). Currently
if (exists("file 2.txt")) {
println("file exists");
}
compiles to
if exist file 2.txt (
echo file exists
)
but it should compile to
if exist "file 2.txt" (
echo file exists.
)
In fact, quoting file names is never wrong, so simply doing it always won't break stuff.