Skip to content

Instantly share code, notes, and snippets.

@kiohtc
Created October 6, 2011 07:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kiohtc/1266787 to your computer and use it in GitHub Desktop.
Save kiohtc/1266787 to your computer and use it in GitHub Desktop.
[BAT] 使用相對路徑執行程式
@echo off
cd /d "%~dp0"
\test\test.exe
rem 代表執行 根目錄下的(x:)\test\test.exe
.\test\test.exe
rem 代表執行 此目錄下的 \test\test.exe
..\test\test.exe
rem 代表執行 上層目錄下的 \test\test.exe
pause>nul
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment