# If Cmds & Batch File



## tripped (May 11, 2007)

I did a search but I coudln't find an answer for this.
I a mtrying to create a simple batch file that offers a user a choice it would simply do an ECHO prompting the user to select either choice 1 or 2, if the user selects choice 1 it would process the xcopy cmd with the /D flag, if the user selects option 2 it would use the same xcopy cmd but without the d flag.

What I am trying to do is simply create a small backup method, the /D being the one that backs up the files tha thave only changed while the straight xcopy cmd would be considered a full backup.

Option 1 - xcopy c:\QUICKB~1 F:\MumBackup\QUICKB~1 /D /E
Option 2 - xcopy c:\QUICKB~1 F:\MumBackup\QUICKB~1 /E

I did some reading on how to do this ,but I am still puzzzled.


----------



## ghostdog74 (Dec 7, 2005)

tripped said:


> I did a search but I coudln't find an answer for this.
> I a mtrying to create a simple batch file that offers a user a choice it would simply do an ECHO prompting the user to select either choice 1 or 2, if the user selects choice 1 it would process the xcopy cmd with the /D flag, if the user selects option 2 it would use the same xcopy cmd but without the d flag.


not going to code the whole batch for you, but some suggestions.
you can use set /p to get your user input. for more info on set, type set /? on your prompt.
also, for if statements, if /?. If you are on older OS, there is a choice command you can use to get user input.


----------

