By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,998 Members | 2,825 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,998 IT Pros & Developers. It's quick & easy.

Help with Batch File

P: 83
I am backing up a file in a batch file but when I run the batch it stops in the middle asking whether the path is a directory or a file? How can I declare that it is a file so that it will not stop in the middle of executing?

[PHP]@echo off
:: variables
set drive=M:\Field Ops\DailyOurVoice_BackUps
set backupcmd=xcopy /f /s

%backupcmd% "C:\Database\Daily_Ourvoice\Data\181\Fri.xls" "%drive%\Fri(181).xls"[/PHP]
Mar 6 '08 #1
Share this Question
Share on Google+
2 Replies

Expert 100+
P: 446

This is in the wrong Forum (Access) and I don't know anything about PHP, however you seem to be using the DOS command XCOPY (which copies multiple files) with the 'all sub-directories' switch '/s'

It seems to me that the process is starting OK then finding another file in a sub-folder and trying to copy that to the same destination.

I would drop the '/s' switch

I would have used COPY not XCOPY

I hope this helps

Mar 9 '08 #2

P: 83
Thanks for the info....I did the changes you mentioned and the batch now runs but does not save the file to the specified location

Mar 10 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.