Input "wrong" answers

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
colmac
Posts: 10
Joined: 29 Nov 2013 11:36

Input "wrong" answers

#1 Post by colmac » 03 Feb 2021 05:48

Hi, I'm very much a newbie here, and cant figure out how to solve a problem.

I have written a batch program with two segments
  • to copy a single database (Lightroom photo database) file on my desktop PC, and rename it with a date/time before moving the original to my laptop
  • to reverse the process
The idea being to have dated backup copies on each machine in case of problems, and only ever a single database file between the two machines to ensure that I cannot even open the database file on the wrong device.

I've then managed to get a simple user input to ask which direction the copy is to be made.

All of this works as I want it to, but I cannot figure out how to deal with "wrong answers".

If I ask for input for example "Copy from A-B or B-A" and look for answers "A-B" or "B-A", how do I reject any key input other than those 2 options?

Incidentally, I haven't decided on the actual wording I want to use for input. This is example text only, I feel "A-B" or "B-A" are too similar and liable to confusion (although the program cannot do any of the copy or move if the wrong direction is selected).

Hope someone can help. Thanks

colmac
Posts: 10
Joined: 29 Nov 2013 11:36

Re: Input "wrong" answers

#2 Post by colmac » 03 Feb 2021 09:42

I have solved it using the first script at

https://www.dostips.com/DtTipsMenu.php

Post Reply