EzGoingKev
Registered User.
- Local time
 - Today, 03:21
 
- Joined
 - Nov 8, 2019
 
- Messages
 - 201
 
Good afternoon.
I have BAT file that creates a text file with directory of the folder that it is in and puts in on the desktop. Here is the code:
dir "%~dp0" /b > "%USERPROFILE%\Desktop\list.txt"
This works 100% for me but I would like to append the name of the folder the BAT file is in to the file name.
For example if the BAT file was in a folder called Dog the BAT file would create a file called "Dog_list.txt".
Is there a simple way to get the folder name added to the filename?
ETA - the folders are located on a server.
 I have BAT file that creates a text file with directory of the folder that it is in and puts in on the desktop. Here is the code:
dir "%~dp0" /b > "%USERPROFILE%\Desktop\list.txt"
This works 100% for me but I would like to append the name of the folder the BAT file is in to the file name.
For example if the BAT file was in a folder called Dog the BAT file would create a file called "Dog_list.txt".
Is there a simple way to get the folder name added to the filename?
ETA - the folders are located on a server.
			
				Last edited: