I am trying to come up with a batch file that will perform the following:
I am not having much luck finding an example of such a script or bits and pieces of it even to put something together.
To search for files in File Explorer, open File Explorer and use the search box to the right of the address bar. Tap or click to open File Explorer. Search looks in all folders and subfolders within the library or folder you're viewing.
The PATH variable would only contain the folder, not its subdirectories (desired result). 3. Invoking program. bat as %PATH%\program.
The Path variable holds the names of folders that are searched if the file being executed is not in the default folder at the command prompt. For example, if all the batch files are in C:\BATCH, and c:\batch is added to the Path environment variable, that batch file can be run from any command prompt.
@echo off
for /d /r "c:\temp" %%a in (*) do if /i "%%~nxa"=="apples" set "folderpath=%%a"
echo "%folderpath%"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With