Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>you can do something like</p> <pre><code>if not exists %directory%\%file% </code></pre> <p>in this way you create a full file-pathname like "c:\myfolder\yourfolder\myfile.txt" and check for it's existence</p> <p><em><strong>Update</em></strong><br> this should works (but it's not tested)</p> <pre><code>:: starting folder set RootPath=c:\myfolder\yourfolder\ ::check all subfolder for /R "%RootPath%" %%d IN (.) DO ( echo %%d :: check all file in each subfolder for %%f IN ("%%~d\*.*") DO ( :: check if your file exist IF "%%~nxf"=="filenameImLookingFor.txt" ( echo Found file here "%%~f" ) ) ) </code></pre> <ul> <li><strong>%%~nxf</strong> will expand to filname with extension, without the path</li> <li>the "~" make also sure that the expanded variable will never contain prefix/postfix doublequte, so that you can add your own without having unexpected double-doublequote (that will obviously mess things up)</li> </ul> <p>Here is a list of useful syntax for FOR variables (from the help of the FOR command)</p> <blockquote> <p>You can now use the following optional syntax:</p> <pre><code>%~I - expands %I removing any surrounding quotes (") %~fI - expands %I to a fully qualified path name %~dI - expands %I to a drive letter only %~pI - expands %I to a path only %~nI - expands %I to a file name only %~xI - expands %I to a file extension only %~sI - expanded path contains short names only %~aI - expands %I to file attributes of file %~tI - expands %I to date/time of file %~zI - expands %I to size of file %~$PATH:I - searches the directories listed in the PATH environment variable and expands %I to the fully qualified name of the first one found. If the environment variable name is not defined or the file is not found by the search, then this modifier expands to the empty string </code></pre> <p>The modifiers can be combined to get compound results:</p> <pre><code>%~dpI - expands %I to a drive letter and path only %~nxI - expands %I to a file name and extension only %~fsI - expands %I to a full path name with short names only %~dp$PATH:I - searches the directories listed in the PATH environment variable for %I and expands to the drive letter and path of the first one found. %~ftzaI - expands %I to a DIR like output line </code></pre> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload