I think Panic’s ROFL was because the “nul” in his post is not a real device or driver, but just an alias, meaning, “instead of outputting to the default output device, con (screen), output to nul (that is output to nothing, don’t give output)”. I’d bet the null.sys file is unrelated to this, and it’s “nul” not “null”. Not sure, LOL. Another example, if instead of “> nul” you added “> prn”, the output would be sent to the printer–at least in the old DOS days.
You can wirte in a .BAT or .CMD file whatever you can write in the command line interface (cmd.exe), one command in each line. (If you don’t want the commands to be shown as they’re run, put a “[ at ]” in front of those you don’t want shown, or “[ at ]echo off” as the first command if you want none shown. This echo is a separate thing from the output.
By the way you don’t need to change the active folder everytime you want to delete files, for example instead of
cd "C:\WINDOWS"
DEL "explorer.exe"
you can enter
del "C:\WINDOWS\explorer.exe"
(I wouldn’t recommend running this though, LOL.) The quotation marks are really necessary only if the pathname includes spaces. And I think that the DEL command can delete folders, empty or not, in WinXP, it’s true that in DOS it didn’t so you needed RD and it was a pain so they made DELTREE, but now DEL will detele anything I think.
And it’s better to name the script with a .CMD extension instead of a .BAT one. The difference is that a .BAT file is taken as a DOS script and run in a 16 bits virtual DOS machine (VDM)–when available: ntvdm.exe in Windows 32 bits, not available in Windows 64 bits. A .CMD file is taken as a Win32/64 file and runs natively. Of course either option works the same most times if it includes simple commands like DEL etc., although ntvdm.exe is processor-intensive. Not sure what happens when you run a .BAT file in a system without builtin VDM (64 bits), I guess it’s just run natively like a .CMD one since there’s no other option… so this would only apply to 32 bits Windows.