USING XCOPY COMMAND TO COPY 1 SINGLE FILE WITH .TXT TO CREATE A BATCH FILE

hI ALL,
i HAVE CREATED A BATCH FILE TO COPY ALL FILES, DIRECTORIES AND SUB DIRECTORIES AND THIS WORKED FINE.  nOW i WANT TO SETUP THE SAME TYPE FILE TO WORK WITH COPING 1 SINGLE FILE OVER BUT CAN'T GET IT TO WORK.  HERE IS WHAT I DID:

XCOPY C:\HOME\housing.mdf*.* Y:\TAAG-TIME-BU\TAAG\

THE THING IS ONCE I SAVE THE .TXT AS A BAT FILE AND DOUBLE CLICK IT, IT COMES UP AND GES AWAY QUICKLY NOT COPYING ANYTHING OVER.  i KNOW I'M DOING SOMETHING WRONG.
bsjldAsked:
Who is Participating?
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.

mds-cosCommented:
Looks like you have a syntex issue.  Try this:

"XCOPY C:\HOME\housing.mdf Y:\TAAG-TIME-BU\TAAG\"
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
Jeff BrownGlobal Helpdesk SupervisorCommented:
the other thing you can do to see what is actually occuring is to
goto   start
up to run
type in cmd  
press ok
and run your batch file from within the cmd console  that should show you what its doing and wehre its failing as the commands will stay in the window and the window won't poof on you.

--Wild
0
Steve KnightIT ConsultancyCommented:
(without the " around it there).

If you have adjusted the paths you may need to put "" around the paths though.

XCOPY "C:\HOME\housing.mdf" "Y:\TAAG-TIME-BU\TAAG"

I suggest you run it from the cmd.exe prompt once to see that it works for you.  It could be a matter of permissions, or if the file already exists for instance then you may need to add options to the xcopy line.

e.g.

xcopy /d/y "c:\home\housing.mdf" "y:\taag-time-bu\taag"

would copy the file if it is newer and overwrite without prompting.

Steve
0
TextReportCommented:
In you BAT file include PAUSE as the last line.
You may wish to include the /i parameter which advises that the destination is a directory

xcopy /i/y "c:\home\housing.mdf" "y:\taag-time-bu\taag"

Cheers, Andrew
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.