Batch的父文件夹位于Variable%〜dp0中.例:
原文链接:https://www.f2er.com/windows/371037.html@echo off&setlocal for %%i in ("%~dp0..") do set "folder=%%~fi" echo %folder%
@echo off&setlocal for %%i in ("%~dp0..") do set "folder=%%~fi" echo %folder%