Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to creat short dos paths for long dos paths

How to creat short dos paths for long dos paths

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorial
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AmarjeetSinghMatharu
    wrote on last edited by
    #1

    Hello All, I am stuck up at a point where in a batch file copy command the destination path includes spaces and copy fails. Please suggest me to generate short paths with '~' from long paths specially containing spaces. Thanks and Regds. Amar.

    M T 2 Replies Last reply
    0
    • A AmarjeetSinghMatharu

      Hello All, I am stuck up at a point where in a batch file copy command the destination path includes spaces and copy fails. Please suggest me to generate short paths with '~' from long paths specially containing spaces. Thanks and Regds. Amar.

      T Offline
      T Offline
      Tony Hill
      wrote on last edited by
      #2

      Just quote the pathname eg: copy "C:\dir one\text.txt" "C:\dir two\test.text"

      1 Reply Last reply
      0
      • A AmarjeetSinghMatharu

        Hello All, I am stuck up at a point where in a batch file copy command the destination path includes spaces and copy fails. Please suggest me to generate short paths with '~' from long paths specially containing spaces. Thanks and Regds. Amar.

        M Offline
        M Offline
        Mila025
        wrote on last edited by
        #3

        Hi, DWORD GetShortPathName( LPCTSTR lpszLongPath, LPTSTR lpszShortPath, DWORD cchBuffer );

        ----------- Mila

        A 2 Replies Last reply
        0
        • M Mila025

          Hi, DWORD GetShortPathName( LPCTSTR lpszLongPath, LPTSTR lpszShortPath, DWORD cchBuffer );

          ----------- Mila

          A Offline
          A Offline
          AmarjeetSinghMatharu
          wrote on last edited by
          #4

          Thanks for the replies, To elobrate the problem, I need to get the short dos path name the one with ~ (For Ex:Prog~1) from the long path names from the doc command prompt. Is it possible to through DOS? Please comment. Thanks and Regds. Amar.

          1 Reply Last reply
          0
          • M Mila025

            Hi, DWORD GetShortPathName( LPCTSTR lpszLongPath, LPTSTR lpszShortPath, DWORD cchBuffer );

            ----------- Mila

            A Offline
            A Offline
            AmarjeetSinghMatharu
            wrote on last edited by
            #5

            Thankyou for the suggestion, I have the following problem at dos command prompt: -------------------------------------------------------------------------------- C:\>C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\BIN\ STSADM.EXE stsadm -o upgrade -forceupgrade -url http://amarjeet-yqt4x9:8080/ --------------------------------------------------------------------------------- 'C:\Program' is not recognized as an internal or external command, operable program or batch file. C:\> ---------------------------------------------------------------------------------- The problem is, DOS command prompt is not recoznising the spaces between the path names. Please guide. Thanks and Regds. Amar.

            M 1 Reply Last reply
            0
            • A AmarjeetSinghMatharu

              Thankyou for the suggestion, I have the following problem at dos command prompt: -------------------------------------------------------------------------------- C:\>C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\BIN\ STSADM.EXE stsadm -o upgrade -forceupgrade -url http://amarjeet-yqt4x9:8080/ --------------------------------------------------------------------------------- 'C:\Program' is not recognized as an internal or external command, operable program or batch file. C:\> ---------------------------------------------------------------------------------- The problem is, DOS command prompt is not recoznising the spaces between the path names. Please guide. Thanks and Regds. Amar.

              M Offline
              M Offline
              Mila025
              wrote on last edited by
              #6

              Hi, Your path should be enclosed in quotation marks: "C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\BIN\STSADM.EXE" stsadm -o upgrade -forceupgrade -url http://amarjeet-yqt4x9:8080/ unles you prefer that notation ;-) : C:\PROGRA~1\COMMON~1\MICROS~1\WEBSER~1\60\BIN\STSADM.EXE stsadm -o upgrade -forceupgrade -url http://amarjeet-yqt4x9:8080/

              ----------- Mila

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups