If I open a console, no matter what operations I have done in it, I hope to track the operation records and finally write them into a file. For example, I have done the following operations in the console:
C:\>set value=1
C:\>Change_Value.bat
C:\>echo 1
1
C:\>set value=2
C:\>echo 2
2
C:\>set value=3
C:\>%value%
'3' is not an internal or external command, nor is it a runnable program
or batch file.
C:\>
Then when I exit the console, I want to save all the run commands above in a file, say Command.log. The content recorded in the file is, for example:
set value=1
Change_Value.bat
echo 1
set value=2
echo 2
set value=3
%value%
Is there any good way? The way we are doing now is to write an echo under each command, and then repeat the command above and write it after the echo. This way is very stupid and easy to make mistakes. Please give me some advice, great experts!
C:\>set value=1
C:\>Change_Value.bat
C:\>echo 1
1
C:\>set value=2
C:\>echo 2
2
C:\>set value=3
C:\>%value%
'3' is not an internal or external command, nor is it a runnable program
or batch file.
C:\>
Then when I exit the console, I want to save all the run commands above in a file, say Command.log. The content recorded in the file is, for example:
set value=1
Change_Value.bat
echo 1
set value=2
echo 2
set value=3
%value%
Is there any good way? The way we are doing now is to write an echo under each command, and then repeat the command above and write it after the echo. This way is very stupid and easy to make mistakes. Please give me some advice, great experts!

ump