Yes, that trick works since very old MS-DOS versions ;-) Alain
Em 14-02-2013 22:30, Eric Auer escreveu: > > Hi! > >> If that doesn't work then a exist.c should be made that friend 1 errorlevel >> if so let me know and I make it > > You misunderstood, IF EXIST does exists but has to > be used in a special way for directory checks ;-) > >>> Is there something like this in FD? > > Yes of course: Type "if /?" to see how it should work. > >>> IF NOT EXIST X:\ZZZ MD X:\ZZZ >>> >>> Everything in front of the MD is ignored, and there is an error if >>> X:\ZZZ does exist. > > I made some experiments: IF EXIST and IF NOT EXIST do > what they should do for files, but apparently cannot > check existence of directories. The trick, which also > should work with MS DOS, is to use a CHARACTER DEVICE > because those "exist" in all directories by definition: > > IF NOT EXIST X:\ZZZ\NUL MKDIR X:\ZZZ > > That does what you wanted to do :-) > > Eric ------------------------------------------------------------------------------ Free Next-Gen Firewall Hardware Offer Buy your Sophos next-gen firewall before the end March 2013 and get the hardware for free! Learn more. http://p.sf.net/sfu/sophos-d2d-feb _______________________________________________ Freedos-user mailing list Freedos-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-user