Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Dos XCOPY QUESTION

Posted on 2008-11-17
9
Medium Priority
?
329 Views
Last Modified: 2012-06-27
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.
0
Comment
Question by:estackpo
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 38

Accepted Solution

by:
Shift-3 earned 668 total points
ID: 22978043
Prepend echo F|


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

Open in new window

0
 
LVL 97

Assisted Solution

by:Lee W, MVP
Lee W, MVP earned 668 total points
ID: 22978064
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
 
LVL 71

Assisted Solution

by:Qlemo
Qlemo earned 664 total points
ID: 22978078
or use copy instead (copy /b W:\TEST.mdb W:\UpdateFolder\Dev2.mdb)
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
LVL 1

Author Comment

by:estackpo
ID: 22978425
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
 
LVL 97

Expert Comment

by:Lee W, MVP
ID: 22978612
Then use copy - there should be no problem.  If there is - post a screen shot so we can see what's going on.
0
 
LVL 1

Author Comment

by:estackpo
ID: 22978686
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
 
LVL 97

Expert Comment

by:Lee W, MVP
ID: 22978798
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
 
LVL 71

Expert Comment

by:Qlemo
ID: 22983221
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
 
LVL 1

Author Comment

by:estackpo
ID: 23042706
I have a workaround for this issue. I just copy the files then rename them. I will split the points.
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month21 days, 1 hour left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question