[dba-Tech] Command line: move

Phil Rosenkranz phil.rosenkranz at co.yakima.wa.us
Mon Apr 11 14:43:42 CDT 2011


Say you have a file at X:\ named FILE.TXT. To move it to the E:\ drive, SAVED folder, type the entire path from the target file X:\FILE.TXT and the entire path to the destination E:\SAVED. The command would look like MOVE X:\FILE.TXT E:\SAVED\

Phil

>From the HELP files...

C:\>help move
Moves files and renames files and directories.

To move one or more files:
MOVE [/Y | /-Y] [drive:][path]filename1[,...] destination

To rename a directory:
MOVE [/Y | /-Y] [drive:][path]dirname1 dirname2

  [drive:][path]filename1 Specifies the location and name of the file
                          or files you want to move.
  destination             Specifies the new location of the file. Destination
                          can consist of a drive letter and colon, a
                          directory name, or a combination. If you are moving
                          only one file, you can also include a filename if
                          you want to rename the file when you move it.
  [drive:][path]dirname1  Specifies the directory you want to rename.
  dirname2                Specifies the new name of the directory.

  /Y                      Suppresses prompting to confirm you want to
                          overwrite an existing destination file.
  /-Y                     Causes prompting to confirm you want to overwrite
                          an existing destination file.

The switch /Y may be present in the COPYCMD environment variable.
This may be overridden with /-Y on the command line.  Default is
to prompt on overwrites unless MOVE command is being executed from
within a batch script.



> On Behalf Of John Bartow
> 
> Hi all,
> I recall that some of you use the windows command line quite a bit yet.
> 
> Can someone tell me what the command line would be to move all folders and
> files contained in a specific folder to another drive?
> 
> It's Something I want to do it a batch files and schedule for archiving
> purposes.
> 
> TIA John B.




More information about the dba-Tech mailing list