pc.bat
can be used in cmd.exe to put the current directory (which is stored in the cmd.exe
pseudo variable %cd%
into the clipboard. It uses the set /p «trick» to suppress writing newlines in
echo`. @rem @rem Put current path into clipboard. @rem @rem set /p in order to suppress @rem newline of echo (https://stackoverflow.com/a/7105690/180275) @rem @echo | set /p="%CD%" | clip