Coding/Script2023. 9. 7. 00:00
echo [TEST]
echo main x0 %~x0
echo main n0 %~n0
echo main nx0 %~nx0
echo main p0 %~p0
echo main pnx0 %~pnx0
echo main d0 %~d0 
echo main dpnx0 %~dpnx0
echo main f0 %~f0

실행 결과

C:\github>test

C:\github>echo [TEST]
[TEST]

C:\github>echo main x0 .bat
main x0 .bat

C:\github>echo main n0 test
main n0 test

C:\github>echo main nx0 test.bat
main nx0 test.bat

C:\github>echo main p0 \github\
main p0 \github\

C:\github>echo main pnx0 \github\test.bat
main pnx0 \github\test.bat

C:\github>echo main d0 C:
main d0 C:

C:\github>echo main dpnx0 C:\github\test.bat
main dpnx0 C:\github\test.bat

C:\github>echo main f0 C:\github\test.bat
main f0 C:\github\test.bat

C:\github>
Posted by chobocho