'if exists' takes a parameter which can be directory, directory/, directory/. directory\ or directory. for example, and should equate to true if the directory exists. The syntax directory\ is explicitly rejected by FindFirstFile and hence was not working - look for this specific case, and if found append a '.'.
Follow-up commit of bc9d68bcbee5c9d4f4582f766a4f552870385361
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55130
-- v2: cmd: Fix 'if exist' with a directory/ as a parameter.