You can use the command prompt, but I prefer to use notepad to create a .bat (batch file) so I don't have to type in the commands to change to the directory my source port is located in. Paste the below text, and go to "Save As" (not save) Change "Save as type:" from "Text Documents (*.txt)" to "All Files" and append whatever filename you save it as with the ".bat" extension at the end. This will create a launchable shortcut that will run the commands automatically when you click it.
Just gonna add a couple things for clarity:
1. I include the filepath of the sourceport so that my batch file can be stored anywhere (such as on my desktop.) If you don't include the filepath, the batch file needs to be inside the same folder as your source port for it to work.
2.
-iwad "C:\DOOM\WADS\IWADS\DOOM2.wad" points to the location of your DOOM2.WAD iwad if its not already located in the same folder as the source port. Make sure it's enclosed with quotation marks (the source port part DOES NOT use quotation marks though)
3.
-file "C:\DOOM\WADS\PWADS\WadName.wad" like -iwad but points to the location of the wad you intend load and record for. remember quotation marks. If there's more than one wad file being loaded at once, just include an additional set of quotation marks followed by a space like
-file "C:\DOOM\WADS\PWADS\WadName1.wad" "C:\DOOM\WADS\PWADS\WadName2.wad"4.
-deh "C:\DOOM\WADS\PWADS\DehName.deh" If the wad uses a dehacked patch that is included as a separate file in the .zip download, you'll want to use this to load it. Some modern wads include the dehacked files inside the wadfile itself so you only really need this for true vanilla wads that use them. quotation marks here too.
notes: EpisodeNumber LevelNumber is only for Doom 1/Ultimate Doom.
-warp 2 1 to go to E2M1. In Doom 2 it's LevelNumber only
-warp 01 for MAP01: Entryway. Also
-skill is 1 through 5, I'm too young to die through Nightmare.
-skill 4 for Ultra Violence. If
-skill is not included, I think it goes to Hurt Me Plenty by default. The command line arguments (things that start with a dash) can be in any order as long as the the filepath of the source port is entered first.
When recording a demo, the game will launch directly to the map without bringing up the starting screen or main menu. There's no visual indication in-game that your demo is recording, unless you attempt the save the game, then a message will tell you that you cannot save during a recording. Quit the game at any time to stop recording. Unless you include a filepath after
-record, the recorded demo can be found in the same folder your source port is located in.
You can playback a recorded demo using
-playdemo "C:\DOOM\DEMOS\DemoName.lmp". In this case you would still use the below arguments, but you should remove the
-record,
-warp, and
-skill arguments because the level and skill data is already contained in the demo file. If you playback a recorded demo, and notice that the player is shooting at walls, alerting monsters without reacting to them, and generally playing unexpectedly poorly, this is a demo behaving "out of sync" and is usually an indication that the proper files were not loaded or in the correct order.
C:\DOOM\WHATEVERSOURCEPORT\Whatever.exe -iwad "C:\DOOM\WADS\IWADS\DOOM2.wad" -file "C:\DOOM\WADS\PWADS\WadName.wad" -deh "C:\DOOM\WADS\PWADS\DehName.deh" -record DemoName -warp LevelNumber -skill DifficultyLevelNumber