Create directory from batch automatically without typing d

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
z3rodowner
Posts: 2
Joined: 15 Jul 2009 20:01

Create directory from batch automatically without typing d

#1 Post by z3rodowner » 15 Jul 2009 20:11

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!

avery_larry
Expert
Posts: 391
Joined: 19 Mar 2009 08:47
Location: Iowa

#2 Post by avery_larry » 16 Jul 2009 19:13

add the /i argument to xcopy:

Code: Select all

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

z3rodowner
Posts: 2
Joined: 15 Jul 2009 20:01

#3 Post by z3rodowner » 17 Jul 2009 06:49

much appreciated 8)

Post Reply