Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: How to copy path to folder/file by command line?  (Read 2556 times)

0 Members and 1 Guest are viewing this topic.

MIRKOSOFT

    Topic Starter


    Hopeful

    Thanked: 2
    How to copy path to folder/file by command line?
    « on: September 25, 2018, 06:02:00 PM »
    Hi!

    I need to copy path of current folder and/or file in that folder by command line.

    How to do it in Windows 10, Windows 3.11 and DOS?

    Thank you for each help, reply, suggestion or comment.

    Miro

    Salmon Trout

    • Guest
    Re: How to copy path to folder/file by command line?
    « Reply #1 on: September 27, 2018, 09:42:54 AM »
    here's Windows XP onwards... highlight what you want to copy and press ENTER. It's in the clipboard.



    MIRKOSOFT

      Topic Starter


      Hopeful

      Thanked: 2
      Re: How to copy path to folder/file by command line?
      « Reply #2 on: September 28, 2018, 07:25:21 AM »
      This works not.
      Output is always to named file.

      For clipboard exist command CLIP - I tried to get help, but error is that command not exist. I know that can't to be used without parameters - where to get syntax?
      Also - exist CLIP in MS-DOS 6.22 ?

      And is possible to get path from any variable? Or other way?

      Thank you.
      Miro

      Salmon Trout

      • Guest
      Re: How to copy path to folder/file by command line?
      « Reply #3 on: September 28, 2018, 09:25:02 AM »
      ....

      BC_Programmer


        Mastermind
      • Typing is no substitute for thinking.
      • Thanked: 1140
        • Yes
        • Yes
        • BC-Programming.com
      • Certifications: List
      • Computer: Specs
      • Experience: Beginner
      • OS: Windows 11
      Re: How to copy path to folder/file by command line?
      « Reply #4 on: September 28, 2018, 10:23:23 AM »
      How to do it in Windows 10

      Windows 10: Clip

      Code: [Select]
      C:\>clip /?

      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.

      in this case you could echo %CD%, or use dir /b as Salmon Trout indicated on the file, and redirect it to CLIP to copy the current directory to the clipboard.

      Windows 3.11 has no documented user-accessible way of copying data from a command prompt window via a command to the Windows Clipboard (Of course, you can use the control menu to mark and copy text shown in the command prompt window). Programs that are aware of Windows can detect it and will be able to copy and paste to and from the Windows clipboard though.


      MS-DOS itself has no concept of a clipboard- only applications do.
      I was trying to dereference Null Pointers before it was cool.

      MIRKOSOFT

        Topic Starter


        Hopeful

        Thanked: 2
        Re: How to copy path to folder/file by command line?
        « Reply #5 on: September 28, 2018, 01:51:33 PM »
        Ok, thank you!

        Now I can use it the way I wanted.

        DOS can have replaced clipboard by file content - but only text.

        Miro