bat 获取当前目录的父目录
@echo offecho batchfile=%0echo full=%~f0setlocal for %%d in (%~dp0.) do set Directory=%%~fd echo Directory=%Directory% for %%d in (%~dp0..) do set ParentDirectory=%%~fd echo ParentDirectory=%ParentDirectory%endlocalpause
本文共 293 字,大约阅读时间需要 1 分钟。
@echo offecho batchfile=%0echo full=%~f0setlocal for %%d in (%~dp0.) do set Directory=%%~fd echo Directory=%Directory% for %%d in (%~dp0..) do set ParentDirectory=%%~fd echo ParentDirectory=%ParentDirectory%endlocalpause
转载于:https://www.cnblogs.com/ibingshan/p/10907275.html