How do I store the last part of directory in a variable?
For example I have the following path: A\B\C\D, I want to store D in variable like file_name=D.
|
How do I store the last part of directory in a variable? For example I have the following path:
| ||||
feedback
|
|
Because of your Windows tag, I assume your Given a variable
Alternatively, should you not have extensions in your Edit: Per your comment about the error. Above is an example on the command line. If you want to perform the same within a batch script, you need to double the
The | ||||
feedback
|
|
Give this a try:
| |||||||||
feedback
|