BAT-Syntax

Question:

Let's say in the batch file:

cd C:\Program Files\path\test\  
start someprg.exe

How, after executing these commands, go back to the directory to the batch file, wherever it is?

Answer:

In fact, both proposed solutions return the remembered working directory , which does not correspond to the literal condition of the problem:

return back to the directory to the batch file, wherever it is

You can change the directory to the one in which the batch file is located, as follows:

CD /D A:\SOME\
REM делаем что-либо с относительными путями
CD /D "%~dp0"
Scroll to Top