Page 1 of 1

Create directory from batch automatically without typing d

Posted: 15 Jul 2009 20:11
by z3rodowner
hello i'm new to this but here is my problem:

i have a batch that copies files from a cd to a new directory but when i run my batch another step asks me if i would like to create a file or directory by hitting f or d .

i was wondering what i could add to the batch so it's automatic with d selected everytime.

@rem BATCH FILE
@echo off
if "%1" == "" goto error1
if "%2" == "" goto error2

xcopy "%1" "%2" /S /E /H
@rem * need d automatically entered



goto endofprogram
:error1
echo You must provide source
echo Syntax:
echo %0 source destination
goto endofprogram
:error2
echo You must provide destination
echo Syntax:
echo %0 source destination
goto endofprogram
:endofprogram

thank you in advance!

Posted: 16 Jul 2009 19:13
by avery_larry
add the /i argument to xcopy:

Code: Select all

xcopy "%1" "%2" /S /E /H /I

Posted: 17 Jul 2009 06:49
by z3rodowner
much appreciated 8)