Windows Technics [Drive and Path Variable]

By admin at 2020-10-11 • 0 collector • 1437 pageviews

Sometimes we take programs and files. Placed in different positions To run the program, you must refer to the current path, making it difficult to write the executable batch file


The solution is to retrieve the current drive and path variables. Wherever you want to place the program, you can always run it


There are 2 variables in this variable and the result is the same


"%~dp0"


%CD%


Writing instructions on the batch file  Let's say you put the program on D: \ utorrent.


cd /d "%~dp0" will return to D: \ utorrent.


cd /d %CD% will return to D: \ utorrent.


The aim is to remove a program that has a set of instructions as a battery file. Where to put it on the computer and run it Batch Files


Requires Login

Loading...