variables - batch scripting: how to get parent dir name without full path? -



variables - batch scripting: how to get parent dir name without full path? -

i'm working on script processes folder , there 1 file in need rename. new name should parent directory name. how in batch file? total path dir known.

it not clear how script supposed become acquainted path in question, next illustration should @ to the lowest degree give thought of how proceed:

for %%d in ("%cd%") set "dirname=%%~nxd" echo %dirname%

this script gets path cd variable , extracts name dirname.

variables batch-file directory parent

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -