Move a file to archive folder in cmd using wildcards

1

1

I'm using this command:

move C:\folder\*.txt C:\folder\archive\*.txt

I'm trying to move multiple files to an archive folder using the *.txt but I get an error that states it cannot find the file specified.

Any suggestions?

Jonathan Guarascio

Posted 2012-12-10T18:25:58.340

Reputation: 11

Answers

3

syntax is move C:\folder\*.txt C:\folder\archive

bummi

Posted 2012-12-10T18:25:58.340

Reputation: 1 569

all this while I was using / instead of \ – Maze Oslo – 2014-05-08T11:07:59.717

2

The move command does not allow wildcards in the destination, which must be an existing directory if you're moving more than one file. (The syntax for move is different than for rename, which may be confusing you. ) Here's an example:

> dir /w
 Volume in drive C is Windows7
 Volume Serial Number is E441-3A51

 Directory of C:\Users\Nicole\Desktop\MoveExample

[.]      [..]     file1    file2    [folder]
               2 File(s)             27 bytes
               3 Dir(s)  507,369,046,016 bytes free

> move file* fold*
The filename, directory name, or volume label syntax is incorrect.

> move file* newfolder
Cannot move multiple files to a single file.

> move file* folder
C:\Users\Nicole\Desktop\MoveExample\file1
C:\Users\Nicole\Desktop\MoveExample\file2
        2 file(s) moved.

Nicole Hamilton

Posted 2012-12-10T18:25:58.340

Reputation: 8 987