BAT file to open CMD in current directory

You can just enter cmd into the address bar in Explorer and it starts up in that path. Likewise for PowerShell.


There's more simple way

start /d "folder path"

you probably want to do this:

cd /d %~dp0
cmd.exe

this will set your current directory to the directory you have the batch file in


Create a file named open_dos_here.cmd with the following lines:

%~d1
cd "%~p1"
call cmd

Put this file at any folder. Then, go to your Send To folder (Win+E; Alt+D;shell:sendto;Enter). Create a shortcut to point to this open_dos_here.cmd

Then, in any folder, select any file or sub-folder. Right-click and select "Send To" and then select open_dos_here.cmd to open the DOS in that folder.