For all you crusty old unix heads, there is a thing in DOS called typing “help”. I’m pretty sure someone mentioned it.
Copying a single file from the C drive to the A drive is pretty much the only thing I know how to do in DOS, aside from typing “dir” to ballpark how much disk space I might have left. My conscious computer memories start with Windows 3.1.
The answer is RECOVER – That’s what you type when you’ve lost something isn’t it?
I used to write some really byzantine AUTOEXEC.BAT and CONFIG.SYS files in my system to eliminate the need to have a bunch of boot disks lying around for various games. What’s asked for in the OP is like trivial baby stuff compared to that.
It often took some elaborate and byzantine DOS batch file just to accomplish some fairly simple thing, just because the batch file language was so limited and primitive. For example, how would you do a batch file that repeats a certain group of lines a fixed number (like 10) of times? (This is a mildly obscure problem, fairly simple to do once you see the “trick”.)
How about this: Using the DATE command in a DOS batch file, or any other trick you can think of, how can you get the date (or parts of it) into environment variables? That one was a bit trickier.
DATE variable
I might think of the first one, but the second one sounds easy. Redirect the output of DATE into a batch file, and then create another batch file named for the first word of the usual date string that sets the variable equal to which ever parameter would be the date. I’d have to actually mess with the DATE command on a real MS-DOS system to know the actual names of the files.
After a while, I just started leveraging QBASIC for anything too complicated for BATCH. I named a file 'RUN.BAT and had it contain @QBASIC /RUN %1, and then I could start any .BAT file with 'RUN %0 and then have the rest of it be QBASIC code. And I think there was a command that would force QBASIC to quit without returning to the editor. SYSTEM, maybe?
Discovering the extensions of CMD.exe resulted in me playing around with doing things in batch again, until I discovered WScript and AutoHotkey.
Edit: repeating something X times:
I cheated and looked up a proper for loop for DOS. I actually did this back then and forgot: You just keep adding a letter to a variable (using something like set a = %%aI, and then use an if command to check for the appropriate number of those letters. I’d forgotten because CMD has a set /a that gives you actual numbers. I kept trying to do it with the actual FOR command.
I’d have to remember how to do it, because it’s been a very, very long time. But sure, I’d figure it out.
BigT’s solution for the fixed-count loop is correct. I actually figured out that one for myself.
His solution for getting the date into an environment variable, although sketchy, is substantially the way I’ve seen it done. I didn’t solve that one myself, though.
There wasn’t Google on MS-DOS, but there was “HELP” that lists the possible commands. And once you find one, “HELP DIR” will get you the details for how to use the “DIR” command, for example.
Personally, I could do it, and I said “piece of cake” in the poll, but I would be much better with a bash console than DOS.
I don’t understand why most people read plain text and consider picture books mainly for children, but then they feel that computers must have pictures and boxes and things to “click”. Like typing “DIR foldername” isn’t a million times easier than double clicking menu after menu until you find what you’re looking for.
I still write and use .bat files, so the hardest part would be finding a usable 5.25" disk.
I am a network admin and do something like 90+% of file operations I need to do at command prompts on Windows and linux machines daily. About the only frile operations I do through a gui are San operations and tis because I don’t feel like learning another set of commands. However I still end up doing san operations from a prompt at times, though I just use help and promptly forget it.
Too many command set and I end up typing ifconfig in dos, dir on a linux box and sh ip int br on a HP switch.
God help me, a month or so ago I had to convert a Cicso pix firewall config to a new ASA. That required going from pix to ios 8.2 to ios post 8.3. (Long story but I got the configs to 8.2 and it was decided to update the ios) All this is done at a prompt and the command set different for each ios version*. And totally different nat configurations.
Slee
8.2 to 8.3 + is kinda close, but different enough to be confusing
There really is no need to use DOS commands these days. Every thing can be done with GUI. Even the recovery mode or installation disk these days do not use DOS commands lines.
Back in windows 3.1 days I know some DOS commands not any more and I have no interest to learn them today.
Something that is conspicuously absent from GUI interfaces is any good way to write “batch files” or “shell scripts” or any equivalent. With a GUI interface, you direct the computer’s actions by moving your mouse pointer around, clicking on things, dragging things, selecting items from menus, and so forth.
With a command line interface, you have some command language, and you can write those same commands into a text file for later, or repeated, execution. (Bonus: substitutable parameters too!)
GUI systems have sometimes developed programming languages for doing stuff like that (e.g., Visual Basic For Applications) that may or may not ever have been an interactive command language, but the idea is the same. You just can’t do that with a GUI, other than by opening a text editor window and typing command or VBA lines.