LoginSignup
1
0

More than 3 years have passed since last update.

バッチファイルがあるディレクトリ名だけを取得

Last updated at Posted at 2020-08-19
@echo off
rem バッチファイルがあるディレクトリ名だけを取得

setlocal

set DIRECTORY_PATH=%~dp0
for %%D in ("%DIRECTORY_PATH:~0,-1%") do set THIS_DIRECTORY=%%~nxD

echo %THIS_DIRECTORY%

endlocal

pause
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0