Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Help concerning X-copy in a batch File  (Read 4224 times)

0 Members and 1 Guest are viewing this topic.

tribalraph

    Topic Starter


    Newbie

    Help concerning X-copy in a batch File
    « on: February 27, 2009, 07:01:45 AM »
    Good morning to all,

    My name's Raphael, I'm a Newbie in MS-Dos command and also in English ;)

    I've just created my first batch file after reading all I could on this forum, so I’d like to thank you all for your help.

    But now I have a minor issue with it:


    @echo off
    :start
    cls
    echo Enter the folder name:
    set /p AccName=
    xcopy e:\default_project_directory d:\automotive\project\%AccName% /O/X/E/H/K

    pause
    goto start



    I’ve created this batch to copy a directory with a lot of folders including restrictions and specific access (I use it in my company).

    But after entered a folder’s name (TEST for example), is always asking me this:

    Des D:\automotive\project\TEST specify a file name
    Or directory name on the target
    (F = file, D = directory)

    So I have to enter D each time, then my question is simple:
    How can I integrate to my batch that I want to create a Directory?

    Thank you in advance for your help

    Raphael

    DaveLembke



      Sage
    • Thanked: 662
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: Help concerning X-copy in a batch File
    « Reply #1 on: February 27, 2009, 10:29:28 AM »
    xcopy e:\default_project_directory\*.* d:\automotive\project\%AccName%\*.* /O/X/E/H/K

    Try the above with the \*.* and you will grab all with wildcard for folders and files.

    @echo off
    :start
    cls
    @echo. Enter the folder name:
    set /p AccName=
    xcopy e:\default_project_directory\*.* d:\automotive\project\%AccName%\*.* /O/X/E/H/K

    pause
    goto start

    tribalraph

      Topic Starter


      Newbie

      Re: Help concerning X-copy in a batch File
      « Reply #2 on: February 27, 2009, 10:37:16 AM »
      That's work!
      Much easy now!

      Thank you Dave ;)