Greeting people of stack overflow! I have lately been trying to learn how to program using batch files and I have been running into problems with some of my tests. I am very new so excuse me if I make rookie mistakes, because, well, I am a rookie. I am trying to make a program that gets the user input and writes it to a text file. This is all fine and dandy until I need the user to enter a single number, no other letters, to a text file. I have a small, reproductable example here:
@echo off
rem saved in C:\Users\<username>\OneDrive\Desktop\Test\Test.bat
echo Enter a number
set /p num="Number: "
echo %num%>> Data.txt
However, when I enter a number, it doesn't write to the text file, however, if I type a string, it does.