How to change to a subdirectory and run an exe using a bat file in a Windows 7 system? -
using bat file, want change sub directory of folder bat file in, , run my_application.exe in directory,
i try:
cd /d %cd%\my subdirectory start %~dp0my_application.exe but doesn't work, says can't find my_application.exe
just indicate start command program start , should starting folder it.
without cd command, can written
start "" /d "%~dp0my_subdirectory" "my_application.exe" if my_application.exe located in subdirectory, or
start "" /d "%~dp0my_subdirectory" "%~dp0my_application.exe" if application located in same folder batch file.
start command take first quoted parameter title new process. avoid problems, empty string ("") included in command title.
Comments
Post a Comment