Dos XCOPY QUESTION

When I run xcopy W:\TEST.mdb W:\UpdateFolder\Dev2.mdb


I get the prompt...Does w:\UpdateFolder\Dev2.mdb specifiy a file name or directory name on the target
(F = File, D = Directory)

I want to run this from a batch file and cannot remember how to supply the F from the command line.
LVL 1
estackpoAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Shift-3Commented:
Prepend echo F|


echo F|xcopy W:\TEST.mdb W:\UpdateFolder\Dev2.mdb

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Lee W, MVPTechnology and Business Process AdvisorCommented:
If you want to put it in a batch file, then create the W:\UpdateFolder in advance.  The /I switch will assume your target is a directory... so if you want to use XCOPY alone, then drop the file name in the destination.

Or use copy with the /Q switch.
0
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
or use copy instead (copy /b W:\TEST.mdb W:\UpdateFolder\Dev2.mdb)
0
OWASP: Avoiding Hacker Tricks

Learn to build secure applications from the mindset of the hacker and avoid being exploited.

estackpoAuthor Commented:
Shift - 3 :

 I am actually trying to do this from within an Access database using the Shell() command and while your solution works from the command line, it does not work from the Shell command.  Not sure why.


Leew:

  Only problem with that is the file is not a directory, but is a file. Also I want to change the name of the file after it is copied.

Olemo:
 
  As in my comment to Shift-3 Copy does not work with the Shell command for some reason.

I might just use the xcopy and then rename the file. If so, I will split the points between the 3 of you.
0
Lee W, MVPTechnology and Business Process AdvisorCommented:
Then use copy - there should be no problem.  If there is - post a screen shot so we can see what's going on.
0
estackpoAuthor Commented:
Copy is not recognized in the shell command.

I have a workaround...I will copy the file with the same name then rename it when it gets there.


Thanks for all your input. I will split the points
0
Lee W, MVPTechnology and Business Process AdvisorCommented:
That doesn't make any sense.  Copy is BUILT IN to cmd.exe and command.com.  A screen shot (seeing is believing) would be helpful.  I use it frequently.
0
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
Copy is build-in, that much is true. For System() call you need an executable. So you have to use
cmd /c copy ...
instead.
0
estackpoAuthor Commented:
I have a workaround for this issue. I just copy the files then rename them. I will split the points.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft DOS

From novice to tech pro — start learning today.