Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
Other versions of this page are also available for the following:
Windows Mobile Not Supported Windows Embedded CE Supported
8/28/2008

This command determines whether a particular file or directory currently exists on the client.

Syntax


fileexists [
filesys path

]

Parameters

filesys path

Fully qualified file system path to the file or directory to test.

Example Code

The following example shows how you can use this command.

Copy Code
; *******************************************
; Checking if files or directories exist
; *******************************************
set dir "\windows"

if boolean `fileexists "%dir%"` == true
  echo "... '%dir%' directory found"
else
  echo "... '%dir%' directory not found"
endif

Remarks

This command outputs TRUE if the named file or directory currently exists on the client or FALSE if it does not.

This command is typically used within backticks to perform command substitution.

See Also