Skip to main content

How do I check for a directory?

  • January 23, 2012
  • 1 reply
  • 0 views

[Migrated content. Thread originally posted on 20 January 2012]

Hi!

I currently need a way to be able to see if a directory exists out on the server before a file is created.
I cannot use the DIR command with "SYSTEM", DIR always returns a a exit code of 0.

Any suggestions??

Thanks!

1 reply

[Migrated content. Thread originally posted on 20 January 2012]

Hi!

I currently need a way to be able to see if a directory exists out on the server before a file is created.
I cannot use the DIR command with "SYSTEM", DIR always returns a a exit code of 0.

Any suggestions??

Thanks!

IF EXIST OUT.txt DEL OUT.txt
IF EXIST [dir] ECHO "dir exists" > OUT.txt