also @ TechSpot: Updated Microsoft EULA prohibits class action lawsuits

TechSpot

xcopy help

Discussion in 'Windows OS' started by thewolfe, May 17, 2003.

Thread Status:
Not open for further replies.
  1. thewolfe Newcomer, in training

    xcopy help

    I want the following batch file to copy a file named "test" located on F: drive in the Doug's Stuff folder to the "Fax" folder on the same drive. What am I missing?

    @Echo off
    xcopy "F:\Doug's Stuff\test*.*" "F:\Doug's Stuff\fax*.*" /V /D /Y /S /K /H/
    exit
  2. Mictlantecuhtli TS Special Forces

    You said Fax is a directory, but the command is to copy test*.* files to fax*.* to the same directory. In addition, there's an unneeded / in the end.
  3. Nic TechSpot Paladin

    Try this ...

    @Echo off
    xcopy "F:\Doug's Stuff\test*.*" "F:\Doug's Stuff\fax\*.*" /v /d /y /k /h
  4. Justin Newcomer, in training

    You don't need an "echo off", you know, and it in fact is helpful to not use that in case one of the copies goes wrong.
  5. thewolfe Newcomer, in training

    Nic,

    Your batch file worked so....I tried to copy a folder using the following and nothing happened. P.S. I do have a folder "dougs stuff" in the "Doug's Stuff" folder.

    Also, if I add the /s switch to your original batch file, it won't work. Why is that?

    @Echo off
    xcopy "F:\Doug's Stuff\dougs stuff*.*" "F:\Doug's Stuff\fax\*.*" /v /d /y /k /h
  6. Justin Newcomer, in training

    /S copies all directories and subdirectories
    You are specifilying a file, or a directory with wildcards. That is an invalid switch to use in that case. IF you wanted to copy all the directories and subdirectories, use /S but no wildcards for source or destination:

    xcopy "F:\Doug's Stuff\dougs stuff" "F:\Doug's Stuff\fax" /v /d /y /k /h /e

    try that instead
  7. thewolfe Newcomer, in training

    That did it. Thanks.
  8. thewolfe Newcomer, in training

    Another question.

    When should/could I use *.* as in
    "F:\Doug's Stuff\fax\*.*" /v /d /y /k /h
  9. LNCPapa TS Special Forces

    When you want to act upon all FILES in a folder

    LNCPapa
  10. legally dead Newcomer, in training

    I am on WinXP. What is wrong with this batch file script. I tried it using local C folders and it works? When I try to use network folders it doesn't

    %echo off

    rem this batch file is
    rem designed to copy
    rem quick styles and
    rem normal template and
    rem quick access toolbar

    xcopy "\\Server\templates\ATS templates\Normal\*.*" " C:\Documents and Settings\%user%\Application Data\Microsoft\Templates\" /e /y
    xcopy "\\Server\templates\ATS templates\Quick Styles\*.*" " C:\Documents and Settings\%user%\Application Data\Microsoft\QuickStyles\" /e /y
    xcopy "\\Server\templates\ATS templates\QAT\*.*" " C:\Documents and Settings\%user%\Application Data\Microsoft\Office\" /e /y

    I am not sure %user% is correct. I want the files to be copied from the server folder to the users folder who is currently logged on. There are other folders under 'documents and settings' e.g. 'all users' 'default user' 'administrator' etc. Is there a way of restricting to the user currently logged on to the PC?

    any help would be cool - legally dead xx
  11. kimsland Ex-TechSpotter

    Yes there's %userprofile%

    But seeming you're going to Application Data, you may as well just write %Appdata%

    This thread is 5yrs old, I really think a new thread would have been preferred though.
Thread Status:
Not open for further replies.