1.

Solve : Help concerning X-copy in a batch File?

Answer»

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
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
That's work!
Much easy now!

Thank you Dave



Discussion

No Comment Found