Move folder from one directory to another in batch script

后端 未结 2 1017
再見小時候
再見小時候 2020-12-04 01:53

Can anyone please tell me how to move a folder from one path to another path using batch script?

For example, I want to move XXX folder (including the contents) from

相关标签:
2条回答
  • 2020-12-04 02:16

    How about the plain old-fashioned:

    move d:\abc\XXX d:\cef\XXX
    
    0 讨论(0)
  • 2020-12-04 02:17

    An example of solution is:

    MOVE "%SystemDrive%\folder" "%UserProfile%\Desktop"
    

    The move is only allowed if the source and destination drive are the same. If the destination folder does not exist then the folder "folder" will be renamed with the name of the destination folder. Example:

    MOVE "%UserProfile%\Desktop\folder" "%UserProfile%\Desktop\folder1"
    

    ("Folder1" does not yet exist)

    An example of illegal syntax for rename the folder is:

    MOVE "%SystemDrive%\folder" "%UserProfile%\Desktop\folder1"
    

    ("Folder1" does not yet exist)

    0 讨论(0)
提交回复
热议问题