Coping one 1 file with wildcard with Robocopy

G

Guest

Hi,

I would like to copy only one file with robocopy using the wildcard .* , I have a file that will be updated that starts with file name 4xxx (the xxx are numbers that will be changed daily but 4 is the always the same) for ex: 4xxx.exe I try to copy only this file with the command for example: robocopy c:\4*.* d:\4*.*

this doesnt work as robocopy looks for the directory 4*.*
This is only a simple example as I need to know how to use the wildcard for a single file with robocoopy
 
M

Matthias Tacke

=?Utf-8?B?am9obmM=?= said:
Hi,

I would like to copy only one file with robocopy using the wildcard .*
, I have a file that will be updated that starts with file name 4xxx
(the xxx are numbers that will be changed daily but 4 is the always
the same) for ex: 4xxx.exe I try to copy only this file with the
command for example: robocopy c:\4*.* d:\4*.* this doesnt work as
robocopy looks for the directory 4*.* This is only a simple example as
I need to know how to use the wildcard for a single file with robocoopy

Strip the file name from the destination, and ifg it has the extension
exe why don't you use it. Always as unambigous as posssible and ambigous
as necessary.

robocopy c:\4*.exe d:\
or
robocopy c:\4???.exe d:\

HTH
 
G

Garry Deane

Hi,

I would like to copy only one file with robocopy using the
wildcard .* , I have a file that will be updated that starts
with file name 4xxx (the xxx are numbers that will be
changed daily but 4 is the always the same) for ex: 4xxx.exe
I try to copy only this file with the command for example:
robocopy c:\4*.* d:\4*.*

this doesnt work as robocopy looks for the directory 4*.*
This is only a simple example as I need to know how to
use the wildcard for a single file with robocoopy

See Robocopy /?

Usage : ROBOCOPY source destination [file [file]...] [options]

robocopy c:\ d:\ 4*

Garry
 
M

Michael Bednarek

I would like to copy only one file with robocopy using the wildcard .* , I have a file that will be updated that starts with file name 4xxx (the xxx are numbers that will be changed daily but 4 is the always the same) for ex: 4xxx.exe I try to copy only this file with the command for example: robocopy c:\4*.* d:\4*.*

this doesnt work as robocopy looks for the directory 4*.*
This is only a simple example as I need to know how to use the wildcard for a single file with robocoopy
[Please don't create lines longer than ~72 characters]

ROBOCOPY requires source and target _directories_ on the command line,
and separate optional file specifications. See ROBOCOPY.DOC or ROBOCOPY
/?
Thus:
ROBOCOPY c: d: 4???.exe

Note that ROBOCOPY requires that the source and target paths must not be
terminated with a back-slash. I recommend reviewing the location of
4???.exe in the root direectory: not good practice.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top