Variable folder name in batch

sabdoul -  
 bat553 -
Hello everyone, well I'm really bad with command lines, and I have a problem, here it is, I would like to create a batch file that allows access to files contained in a folder, the only problem is that this folder will always have the same path except that in its hierarchy a folder name will differ each time. Here’s what I want to do:

IF NOT EXIST "C:\Users\..........\variable_folder_name\fi*.txt"

variable_folder_name is the last folder that has a varying name and contains the files I want to access.
Is it possible to do this, and if yes, how should I proceed?
thanks

3 answers

bat553
 
And what is the answer??
1
dubcek Posted messages 18627 Registration date   Status Contributor Last intervention   5 659
 
hello
how to find this name? in the list of folders or in a variable?
set NAME=folder_name_variable IF NOT EXIST "C:\Users\.........\%NAME%\fi*.txt" 
0
sabdoul Posted messages 47 Status Member
 
Hello, I found a solution but thank you for this response.
0