YOGYUI
Windows Batch Script::배치 파일의 경로 얻기 본문
반응형
Get path of the batch script file
%~dp0 구문을 활용하면 된다
예를 위해 C:\Test\Test1.bat 파일을 생성한 뒤 다음과 같이 스크립트 작성
@echo off
set CUR_PATH=%~dp0
echo %CUR_PATH%
커맨드 라인 툴에서 실행해보자
c:\Test>test1.bat
c:\Test\
c:\>c:\Test\test1.bat
c:\Test\
배치 파일(test1.bat)이 존재하는 경로임을 알 수 있다
출처: https://stackoverflow.com/questions/3827567/how-to-get-the-path-of-the-batch-script-in-windows
반응형
'Software > Etc' 카테고리의 다른 글
Jenkins::Pipeline - Slave node 오프라인 시 Stage 무시하기 (0) | 2023.02.08 |
---|---|
Linux - USB Device 접근권한 영구변경 (chmod permanently) (0) | 2022.04.04 |
Tistory::notify-Notice_Blog_New 유입링크 해석하기 (2) | 2021.10.29 |
PyCharm - Run with Python Console 동일 콘솔에서 실행하기 (0) | 2021.09.24 |
알고리즘 - 평균 구하기 (0) | 2021.09.10 |
Comments