Hello,
How to get the current folder name (not the full path) ?
In other words, how to get the last part of a string like
C:\folderA\folderB\folderC
using the bachslash delimiter "\"
Thanks.
How to get the current folder name ?
Moderator: DosItHelp
Thanks so much, it helps me.
I used it in this srcipt, to archive the folder contaning the BAT script:
Folder2RAR.bat
and I can use the same BATCH file for any folder.
Thank you.
I used it in this srcipt, to archive the folder contaning the BAT script:
Folder2RAR.bat
Code: Select all
FOR %%a in ("%CD%") DO SET CurFol=%%~na
CD..
WinRAR a "%CurFol%.RAR" "%CurFol%"
and I can use the same BATCH file for any folder.
Thank you.