I'm new to batch scripts and I don't know what >nul in this self-replicating file code means.Can you explain it please?
copy %0 "new.bat" > nul
> means: "put the output to..."
nul is a "Nirwana-Device"
so
> nul will send the output of the copycommand to Nirwana, so that it doesn't write to the screen.
You could also write the output to a file with >file.txt
For example try these lines:
echo hello world
echo hello world again >nul
echo hello beautiful world >file.txt
type file.txt