Results 1 to 12 of 12

Thread: Suppressing xcopy prompt...

  1. #1
    Senior Member watercooled's Avatar
    Join Date
    Jan 2009
    Posts
    11,478
    Thanks
    1,541
    Thanked
    1,029 times in 872 posts

    Suppressing xcopy prompt...

    Is it possible to get xcopy to copy just one file to another location without prompting:
    Does destination specify a file name or directory name on the target (F = file, D = directory)?
    I know you can get it to stop prompting if you want the destination to be a folder by adding "/" to the end of the destination, is there anything to stop this prompt when copying a file though?
    Thanks

  2. #2
    <<== UT3 Player spoon_'s Avatar
    Join Date
    Nov 2008
    Location
    London
    Posts
    2,071
    Thanks
    113
    Thanked
    139 times in 131 posts

    Re: Suppressing xcopy prompt...

    Which prompt you talking about? To overwrite?

  3. #3
    Senior Member watercooled's Avatar
    Join Date
    Jan 2009
    Posts
    11,478
    Thanks
    1,541
    Thanked
    1,029 times in 872 posts

    Re: Suppressing xcopy prompt...

    No I mean the one I quoted, it pops up when I run the batch file because I'm only backing up one file and it doesn't know whether 'destination' is a file or directory name.

  4. #4
    Senior Member
    Join Date
    Jul 2008
    Posts
    394
    Thanks
    18
    Thanked
    29 times in 25 posts

    Re: Suppressing xcopy prompt...

    robocopy

  5. Received thanks from:

    watercooled (20-02-2010)

  6. #5
    <<== UT3 Player spoon_'s Avatar
    Join Date
    Nov 2008
    Location
    London
    Posts
    2,071
    Thanks
    113
    Thanked
    139 times in 131 posts

    Re: Suppressing xcopy prompt...

    Pipe it in then..

    Create a text file with a "F", lets assume its file.txt

    XCOPY /i "Source_path" "Destination_path" < file.txt

    Failing this, did you hear about robocopy?


  7. Received thanks from:

    watercooled (20-02-2010)

  8. #6
    Senior Member watercooled's Avatar
    Join Date
    Jan 2009
    Posts
    11,478
    Thanks
    1,541
    Thanked
    1,029 times in 872 posts

    Re: Suppressing xcopy prompt...

    Thanks, I never thought of that. Also is there a simple way to get a batch file to purge old backups from a folder for example after there are 5 files it starts deleting the oldest one? It does sound like a bit of a stretch for a batch file though...

  9. #7
    Senior Member
    Join Date
    Jul 2008
    Posts
    394
    Thanks
    18
    Thanked
    29 times in 25 posts

    Re: Suppressing xcopy prompt...

    Quote Originally Posted by watercooled View Post
    Thanks, I never thought of that. Also is there a simple way to get a batch file to purge old backups from a folder for example after there are 5 files it starts deleting the oldest one? It does sound like a bit of a stretch for a batch file though...
    robocopy is the way to go....
    /MAXAGE:n :: MAXimum file AGE - exclude files older than n days/date.

  10. #8
    Senior Member watercooled's Avatar
    Join Date
    Jan 2009
    Posts
    11,478
    Thanks
    1,541
    Thanked
    1,029 times in 872 posts

    Re: Suppressing xcopy prompt...

    Ah thanks again. I made my backup template on XP so I used xcopy but it looks like it's definitely worth using robocopy for this!!

  11. #9
    Registered User
    Join Date
    Feb 2010
    Posts
    1
    Thanks
    0
    Thanked
    0 times in 0 posts

    Re: Suppressing xcopy prompt...

    Use the following command and it will work.

    echo f | xcopy /Y source destination

    It worked for me and you won't have to use a third party program if you don't want to.

  12. #10
    CWH
    CWH is offline
    Registered+
    Join Date
    Jan 2010
    Location
    Cambridge
    Posts
    80
    Thanks
    0
    Thanked
    8 times in 8 posts

    Re: Suppressing xcopy prompt...

    Also, RichCopy is a useful alternative.
    Another M/S sideline like RoboCopy, but a GUI version.

    Colin

  13. #11
    Senior Member MaddAussie's Avatar
    Join Date
    Dec 2006
    Location
    Deepest Darkest Dorset
    Posts
    1,708
    Thanks
    628
    Thanked
    297 times in 179 posts
    • MaddAussie's system
      • Motherboard:
      • Asus ROG Strix Z370G
      • CPU:
      • i7 8700k (5.1Ghz)
      • Memory:
      • 16Gb
      • Storage:
      • 500G 960 EVO NMVE
      • Graphics card(s):
      • GTX 1070
      • PSU:
      • Corsair RM650i
      • Case:
      • Corsair Carbide A1r 240
      • Operating System:
      • Win 10
      • Monitor(s):
      • 24" Dell HD + Samsung HD

    Re: Suppressing xcopy prompt...

    there is a GUI for robocopy that will let you build whole batch files

  14. #12
    Senior Member watercooled's Avatar
    Join Date
    Jan 2009
    Posts
    11,478
    Thanks
    1,541
    Thanked
    1,029 times in 872 posts

    Re: Suppressing xcopy prompt...

    Yeah I have richcopy on my PC it's really useful. For this though I ended up using my original script but I added a / to the end so it just creates a new folder each time. I may make one which purges old backups soon but for now this one works fine.
    Thanks for all the help everyone!!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Clicking Reply/Quick Reply button on old posts displays prompt
    By Paul Adams in forum HEXUS Suggestions
    Replies: 0
    Last Post: 16-06-2008, 08:24 AM
  2. Xcopy & Secure Folders
    By philb101 in forum Software
    Replies: 1
    Last Post: 28-09-2006, 06:04 PM
  3. Replies: 2
    Last Post: 04-07-2005, 10:49 PM
  4. How do i open a file in command prompt?
    By nvening in forum Software
    Replies: 13
    Last Post: 30-01-2005, 12:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •