Welcome to Windows Help!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Copy file problem

 
   Windows Help (Home) -> Windows XP Help RSS
Next:  Update Manager  
Author Message
Mangler

External


Since: Dec 4, 2008
Posts: 5



(Msg. 1) Posted: Thu Dec 04, 2008 8:35 am
Post subject: Copy file problem
Archived from groups: microsoft>public>windowsxp>help_and_support (more info?)

I have the DB backed up everynight automatically and am trying to
create a .bat file to automatically copy the directory of the back ups
to a folder on my PC. I am running a test and everything works with
one weird flaw, here is what I have so far:

COPY /y C:\test.txt Y:\serverBakUp

It puts the file on my PC but does not retain the original file name.
After I run that script the test.txt file gets copied to my PC but it
is name serverBakUp ( the name of the directory it goes to ) with no
file extention. What am I missing here?

 >> Stay informed about: Copy file problem 
Back to top
Login to vote
Mangler

External


Since: Dec 4, 2008
Posts: 5



(Msg. 2) Posted: Thu Dec 04, 2008 9:37 am
Post subject: Re: Copy file problem
Archived from groups: per prev. post (more info?)

robocopy is freaking awsome! Thanks for that one.

 >> Stay informed about: Copy file problem 
Back to top
Login to vote
Mangler

External


Since: Dec 4, 2008
Posts: 5



(Msg. 3) Posted: Thu Dec 04, 2008 10:07 am
Post subject: Re: Copy file problem
Archived from groups: per prev. post (more info?)

One question on robocopy. I have it set to monitor a directory and it
is working great, however if I restart the machine will that directory
still be monitored or do I have to re-run the script each time that
happens?
 >> Stay informed about: Copy file problem 
Back to top
Login to vote
Big_Al

External


Since: Dec 4, 2008
Posts: 25



(Msg. 4) Posted: Thu Dec 04, 2008 11:40 am
Post subject: Re: Copy file problem
Archived from groups: per prev. post (more info?)

Mangler wrote:
> I have the DB backed up everynight automatically and am trying to
> create a .bat file to automatically copy the directory of the back ups
> to a folder on my PC. I am running a test and everything works with
> one weird flaw, here is what I have so far:
>
> COPY /y C:\test.txt Y:\serverBakUp
>
> It puts the file on my PC but does not retain the original file name.
> After I run that script the test.txt file gets copied to my PC but it
> is name serverBakUp ( the name of the directory it goes to ) with no
> file extention. What am I missing here?

COPY /y C:\test.txt Y:\serverBakUp\test.txt

or

COPY /y C:\test.txt Y:\serverBakUp\

Also take a look at robocopy. It has a /MIR command that mirrors a
folder and subfolder structure and files with one simple command. Great
for backups. It takes into consideration files deleted too. It also
skips files that are not touched.
 >> Stay informed about: Copy file problem 
Back to top
Login to vote
Mangler

External


Since: Dec 4, 2008
Posts: 5



(Msg. 5) Posted: Thu Dec 04, 2008 1:19 pm
Post subject: Re: Copy file problem
Archived from groups: per prev. post (more info?)

OK I think I am on the last step here. Do you know off the top of
your head how I can get a .bat file to run without actually showing
the dos window?
 >> Stay informed about: Copy file problem 
Back to top
Login to vote
Big_Al

External


Since: Dec 4, 2008
Posts: 25



(Msg. 6) Posted: Thu Dec 04, 2008 2:36 pm
Post subject: Re: Copy file problem
Archived from groups: per prev. post (more info?)

Mangler wrote:
> One question on robocopy. I have it set to monitor a directory and it
> is working great, however if I restart the machine will that directory
> still be monitored or do I have to re-run the script each time that
> happens?

I've never used the monitor. But I think you have to have robocopy
running, so yes, you'll have to run the batch.
CTRL-ALT-DEL will tell you if its running better probably.
 >> Stay informed about: Copy file problem 
Back to top
Login to vote
Big_Al

External


Since: Dec 4, 2008
Posts: 25



(Msg. 7) Posted: Thu Dec 04, 2008 5:37 pm
Post subject: Re: Copy file problem
Archived from groups: per prev. post (more info?)

Mangler wrote:
> OK I think I am on the last step here. Do you know off the top of
> your head how I can get a .bat file to run without actually showing
> the dos window?
You might be able to make a shortcut to it, I know shortcuts have the
ability to specify run minimized.
 >> Stay informed about: Copy file problem 
Back to top
Login to vote
Mangler

External


Since: Dec 4, 2008
Posts: 5



(Msg. 8) Posted: Fri Dec 05, 2008 9:06 am
Post subject: Re: Copy file problem
Archived from groups: per prev. post (more info?)

> You might be able to make a shortcut to it, I know shortcuts have the
> ability to specify run minimized.

Figured it out! I have seen a lot of similar questions on how to run
the .bat file with the robocopy command without showing the "DOS"
window. I will post the solution in case someone else runs into this.


You need to create a vbs file to run the .bat program and add a "0"
param at the end of the vbs statment like so:

Set WshShell = WScript.CreateObject("WScript.Shell")
Return = WshShell.Run("cmd.exe /K ""FILE_NAME.cmd""", 0, true)

That runs the command without showing the window.
 >> Stay informed about: Copy file problem 
Back to top
Login to vote
M.I.5

External


Since: Dec 3, 2008
Posts: 19



(Msg. 9) Posted: Fri Dec 05, 2008 11:00 am
Post subject: Re: Copy file problem
Archived from groups: per prev. post (more info?)

"Mangler" wrote in message

>I have the DB backed up everynight automatically and am trying to
> create a .bat file to automatically copy the directory of the back ups
> to a folder on my PC. I am running a test and everything works with
> one weird flaw, here is what I have so far:
>
> COPY /y C:\test.txt Y:\serverBakUp
>
> It puts the file on my PC but does not retain the original file name.
> After I run that script the test.txt file gets copied to my PC but it
> is name serverBakUp ( the name of the directory it goes to ) with no
> file extention. What am I missing here?

Try:

COPY /y C:\test.txt Y:\serverBakUp\

(the trailing '\' identifies serverBakUp as a folder whereas if it is
missing it becomes a file name.
 >> Stay informed about: Copy file problem 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Problem launching Word by clicking on a file in a remote f.. - I have had many problems since running a registry "cleaner" and installing SP3. I have posted several of these and responses have been helppful, but one serious problem remains. I have been keeping the files I am currently working with on ...

Yet another boot problem - Please help?!?! Windows XP Pro SP3 - Windows will display the splash screen at startup but will not boot to the logon screen. All I get is a blank screen. I have to do a reset or hard boot where I can boot up in safe mode with networking. I found..

CD Problem??? - I am running a Toshiba Laptop with a TEAC DW-224E CD/DVD. It will read burned mp3 files but will not play Commercial music CDS and will not read or execute program files e.g. Norton Install disk! I have reinstalled the CD drivers and the same situation...

Problem with security - I am having an awful problem with this certain window popping up all the time and not sure what to do. It says "Warning visiting this site may harm your computer! This web site probably contains malicious software program, which can cause damage ...

XP Reinstall Problem - I tried to reinstall XP and I am getting a blue screen only
   Windows Help (Home) -> Windows XP Help All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]