There is a definite failure to communicate.
Nobody is suggesting you write the script at the command prompt (although you can). Use an editor (notepad will work) to write your script (batch file); save it with any name you like but with a
bat extension. Open up a command window, navigate to the directory where you saved your script/batch file and run using the name you saved the script with and redirecting the error output to the log.txt file:
script 2>>log.txt
I'm not sure what this is all about:
script 0 2>>log.txt
but the zero is passed as a command line parameter which is not referenced in your script and therefore servers no purpose. This piece of the command
2>>log.txt sends the error stream to the log file.
Have you even tried to run your batch file. Even if incomplete, it's a good idea to at least find any syntax errors and maybe even some logic errors. You've written the logic for menu selections 2 and 3, so test with them and see the results yourself. Better to test as you write rather than wait until the script is 'finished' and then have to slog through all the errors at once.