Windows shell command to get the full path to the current directory?

前端 未结 14 1711
一向
一向 2020-11-30 17:51

Is there a Windows command line command that I can use to get the full path to the current working directory?

Also, how can I store this path inside a variable used

14条回答
  •  一生所求
    2020-11-30 18:37

    Create a .bat file under System32, let us name it copypath.bat the command to copy current path could be:

    echo %cd% | clip
    

    Explanation:

    %cd% will give you current path

    CLIP
    
    Description:
        Redirects output of command line tools to the Windows clipboard.
        This text output can then be pasted into other programs.
    
    Parameter List:
        /?                  Displays this help message.
    
    Examples:
        DIR | CLIP          Places a copy of the current directory
                            listing into the Windows clipboard.
    
        CLIP < README.TXT   Places a copy of the text from readme.txt
                            on to the Windows clipboard.
    

    Now copyclip is available from everywhere.

提交回复
热议问题