View Full Version : How to use DOS- a class taught by Mr. Iconoclast
chaos master
06-19-2006, 04:39 PM
Here are the previous notes:
Well, if you want, I can start telling you about DOS. Or at full, MS-DOS. DOS is just a shorter term. 'MS' means 'Microsoft', and 'DOS', means Disk Operating System. Everyone just calls it DOS. But enough of the obvious stuff. I can tell you what I know about commands in DOS. For now, I can just tell you this until you're ready for more. In the Start Menu, there is a 'Run' option in the right pane. When you click that option, type 'cmd' (case-insensitive), and click OK. A black prompt should come up. It is a DOS command prompt, but it does not mean you are running in DOS mode. Unless you have a version of Windows earlier than NT/XP, you have to use a bootable disk for that. I stand with DarthBrady: Damn Microsoft for ripping out DOS, as unnecessary for today's work as it is.
In this command prompt, you use what is called a command-line interface. Windows uses a GUI, or graphical user interface, where you can just point and click on what you want rather than having to type it. DOS was the OS before Windows at the time of the 1980s and 90s. Maybe 70s. Computers before then were only affordable by large companies and had no famous operating systems known today. Anyway, type and submit the 'EXIT' command, and the prompt closes. If you just click the close button, it will close 'hesitantly'. Uppercase, lowercase, it doesn't matter. That's just an example command. Let me know when you're ready for more.
Okay, now something else. Go into the command prompt and type 'tree.' The computer will display all files in a tree on the selected drive. Cool!!!!! You can use this to see files on even restricted drives and such.
Well, some of the other commands use the file path paramater. The 'CD' command (Lowercase or uppercase doesn't make a difference.) is used to change the current directory in DOS. Type CD [directory]. Or, as you can do with many commands, you can type CD /? to view help on what the command does. But I will explain it myself. For example, if you type CD C:\GAMES, DOS will go to the Games folder of your hard disk letter C. CD C:\WINDOWS\SYSTEM32 also works. Or, if you are already in the directory C: (root directory of your hard disk), type CD GAMES, and since you are already in C:, it will take you to C:\Games without having to type the 'C:\'. What to do in these directories you can get to is something I will explain later.
But there is something else you need to know. What if you want to go in the directory C:\Documents and Settings? To do that, you must type the file path in quotes because the spaces in the folder name make it look like you want to go in a non-existing directory, C:\Documents, making 'and' and 'Settings' paramaters to the command prompt. So put it in quotes like this: CD "C:\Documents and Settings". You can also type the directory in MS-DOS format like this: CD C:\DOCUME~1. In the real MS-DOS mode, filenames as well as folder names couldn't have more than 8 characters in the name and 3 in the file extension. In a file like Paint Shop Pro Image.pspimage, invalid characters such as spaces are removed (PaintShopProImage.pspimage), the file extension is cut down to three letters (PaintShopProImage.psp), only the first six characters of the file name are kept ending the file name with a tilde (~) and a number 1 (PaintS~1.psp), and letters are always uppercase (PAINTS~1.PSP). Actually, DOS is case-insensitive. This means you can type 'cd' or 'CD'; it doesn't matter. You can type paints~1.psp if you're lazy with the Caps Lock key.
But as long as Windows XP is running, you don't need to type longfi~1.doc instead of LongFileName.doc. With Windows running, DOS doesn't limit file names to 8 characters. But you must use the FILENM~1.EXT format if your file has spaces in it or use quotes in the directory paramater. If your filename is under 8 characters but still has a space, D O S.txt, for example, it is like this in DOS mode: DOS~1.TXT. Because invalid characters (spaces) were removed, there is still a ~1 at the end. If there are two files, Document by Word.doc and Document Made by Word.doc, one of them must have the DOS file name DOCUME~1.DOC and the other DOCUME~2.DOC. Do you have any questions about the 'CD' command?
Yes, use the 'DIR' command to see the folder and file names in DOS mode. You can also type an optional paramater, DIR [directory], to see the directory information for a specified directory. For example, DIR C:\GAMES shows you the contents and file sizes and stuff of the C:\Games directory. If you just enter 'DIR', information for the currently browsed directory is displayed. Does this make sense?
Fierce Deity
06-19-2006, 04:41 PM
Okay cool. Now post more things.
Iconoclast
06-19-2006, 04:48 PM
I have to go now. I don't know if I'll be back tomorrow or until a week even. And FD, you spammer! JK, of course.
Fierce Deity
06-19-2006, 04:53 PM
You will be. They all come back.
pizzaman
06-19-2006, 07:31 PM
How is DOS useful though? I mean what do you guys use it for?
Iconoclast
06-19-2006, 07:42 PM
Now for more DOS. When you are browsing a directory, DOS commands aren't the only thing you have to type. If you are in C:\Games\Nintendo 64\Project 64 v1.6, you can type Project64 to launch Project64.exe from the command prompt (assuming that it is in your currently browsed directory). You can also type Project64.exe instead of Project64 to run Project64.exe from the current directory. Or if you're really strict, you can type C:\GAMES\PROJEC~1\NINTEN~1\PROJEC~1.EXE. Type that instead of using the quote method like so: "C:\Games\Project64 v1.6\Nintendo 64\Project64.exe". If you use PROJEC~1 instead of Project64 v1.6, it will work more often. What if you use the command on other people's computers, and the person has a directory C:\Games\Project64 v1.7 instead of v1.6? Your filepath will not be found, unless, of course, there is also a v1.6 directory, but I don't think it's over halfway likely they keep multiple versions of Project64 installed. But whether their Project64 folder is named Project64 v1.6 or Project64 v1.7, the DOS name for the folder will always be PROJEC~1. So if you don't know what version of Project64 is installed, but only knowing that it's in C:\Games (which it usually isn't), you can just say PROJEC~1. This is an advantage to using the DOS format of a file name. Type this in your command prompt if you have Project64 installed in your Program Files like most users do:
C:\PROGRA~1\PROJEC~1\PROJEC~1.EXE
Or, if you're already in your Project 64 v1.6 folder, you can just type projec~1.exe. Again, case does not matter.
Now, I will explain using a sort of "Open With..." command. Let's say you don't want to open Project64 and THEN open the ROM Super Mario 64.zip. If you type the filepath of Project64 and then the filepath of the ROM you want to open (Super Mario 64.zip), Project64 will run and immediately start Super Mario 64. Like so:
C:\PROGRA~1\PROJEC~1\PROJEC~1.EXE C:\GAMES\ROMS\SUPERM~1.ZIP
In order for this to work, you must have Project64 v1.x installed in your Program Files folder and a ROM Super Mario 64.zip located in C:\GAMES\ROMs. Or it can be named supermxx.zip. Try it out. However, you cannot do this:
PROJEC~1.EXE C:\GAMES\ROMS\SUPERM~1.ZIP
Even if you are already in the directory that Project64.exe is stored in, it will not work. You must type the full file path for both files.
What the DOS command prompt will do if you type Project64(.exe, if you want) is get Windows XP to execute it. If Windows XP is not running and you are purely running in MS-DOS mode, PROJECT64.EXE will not run. It will say: "This program cannot be run in DOS mode." Many programs designed for Windows will not work in DOS, but vice versa is ALMOST always true. For example, the NESticle NES DOS emulator will not run right on Windows. There is no way to make a program compatible in DOS mode either; DOS is a completely different operating system designed before Windows. Old, pixilated, VGA, 4-bit or 8-bit, 320x200 or 640x480 pixel resolution games will run in DOS. DOS-compatible programs usually have a similar interface to the command prompt. They don't have a file icon, there doesn't have to be a black screen like in the command prompt; it could be any color or a nicely imaged pixilated VGA background like in Wolfenstein 3-D or Spear of Destiny, you'll learn what DOS programs are like as you run 'em. But 32-bit 1,024x768 pixel resolution (your Windows XP desktop resolution only at default) files and programs like cool 3-D SWF Flash object files will never be compatible in pure DOS. MAME arcade games are pixilated, VGA-like games that may be compatible in DOS and probably have a DOS emulator. Same thing with NES and SNES games.
You can't type files in DOS. If you type WORDDOC.DOC, Microsoft Word will not run and just load the word document. DOS will only detect files with the extensions EXE (Windows Executable), COM (MS-DOS Executable), and BAT (MS-DOS Batch File). Correct me if I'm wrong; maybe in Windows XP, you can type files in a command prompt and they'll load, but I don't think it likely enough to bother checking. I'm lazy tonight, especially on this finger-paining laptop.
Are you ready for level 5?
Fierce Deity
06-19-2006, 08:11 PM
This is a particularly long lesson, and I'd like to do it when I am more awake, as I am very sleepy now. I badly screwed with my sleeping schedule, and now that I have fixed it, I'm like an elderly person. I wake up at like 7am and get sleepy aroun 8pm.
DarthBrady
06-19-2006, 11:00 PM
Oh great, you decided to star this after all!
CM, I hope you dont mind, if I add a little. Here are some hotkeys to go with what CM posted above, and a how-to on setting up drives and disks for DOS use.
C:> (an example of the command prompt)
HOTKEYS:
CTRL + S (hotkey to STOP SCROLLING the screen Display
CTRL + C (hotkey to STOP a dos COMMAND)
CTRL + ALT + DEL (reboot, of course)
NOw, for some commands!
DIR (displays the contents of a directory or disk)
DIR/P (displays contents, page by page)
DIR/W (displays contents in paralell rows)
-These will display different contents of folders, drives, or diskettes.
Lets say you wanted to see what in the folder titled "games" on Hard Disk C: .
Type "c:" to get to drive c:
THen type "cd\games" to reach the folder. YOu can now type any of the 3 to read the folder contents. if you want to exit the folder and go back to the c: disk, simply type "CD\" to get there.
FORMAT (formats a diskette or hard disk drive)
to use this type FORMAT then use a space, and type the drive letter you wish to format followed by a colon. so to format dive c:, it will look like this~
Example----- FORMAT C:
FDISK (DOS disk partition utilty)
DISKPRT (the same, but only for versions 7+)
**NOTE**
Remember DOS is an old OS. In its time, gigabytes wer like a surreal dream for most people, so you should know that DOS originally could only recognize up to 2,047MegaBytes or 2Gigabytes!
So if you plan on using a larger disk, you can, as long as you version of DOS has large disk support, I suggest version 6.22, it is by far the most versatile and user friendly.
So if you are using a drive larger than 2 GB, run the FDISK command, and the first screen wil ask if you would lke to use large disk support (if you have it installed.) Select YES by pressing "Y"
Now you are at the FDISK Menu. first I recommend pressing "4" to check for any existing partitions on the drive. If there are, escape back to the menu, and choose the delete partion setting by pressing the assinged number (ususally 2 or 3, depending on the version) and delete the partions.
YOU MUST RESTART BEFORE GOING FURTHER, BUT THE DRIVE WILL BE BLANK, SO MAKE SURE YOU HAVE A BOOT DISK TOO USE THE FDISK UTILITY AfTER REBOOTING.
once back in FDISK (using it on the bootable dos floppy) this is what to do:
-First, create a primary DOS partition(menu 1), setting it to maximum allowable size, which will be "2047" (2.047GB)
-Now it will create the partition, and ask for a label, which will be the name for the "drive". the label can be a maximum of 11 charaters long.
OK, so lets say you used a 10GB hard drive. you still have 8GB of space dos wont know about, usless you partion it into 2GB drives as well. how you say?
First, go to the main FDISK menu again, and go to the "set active partition" setting. THe ACTIVE partition is the one that will act as your Master hard disk,
usually c:. This will be the drive you install the DOS Operating system onto.
Now that you have an active main partition, you can create 2GB max. partions
for the rest of the 8GB you have. These will be called SECONDARY partions. they also each will recieve their own drive letter, and label.
They will be setup the same way as the first, only this time use the "Create a secondary partion or Logical Disk Drive" setting intsead of Primary.
REMEMBER the last dive may not be a whole 2BG like the first four, so just make sure to use tha max allowed and you'll be fine.
So now you have a 10GB Hard Drive, Set as Five 2GB drives, ready for dos. so you should now have a drive c:,d:,e:,f:, and g:.
THis will automatically chang the CD-ROM drive letters to the next available drive letter, making your use-to-be drive d: cd-rom, into drive h:
***NOW YOU MUST USE FORMAT ON ALL 5 HARD DISK PARTIONS**
IF YOU DO NOT FORMAT ALL FIVE BEFORE USING THE DRIVE(S), THE DISK WILL FAIL. you will also have to re-label the drives, if ti asks to do so upon completing each format for each drive letter, c thru g.
FINALLY, you now have a Hard disk ready to install DOS to! YEAH!
NOTE: DOS is only 100% compatible with pre-Windows 98 Pentium 3 Motherboards. You CAN make DOS rum on a pentium 3, but it is a LOT of manual labor, trust me I just did it to a AMD K7M 800Mhz board, and it was a bee-otch!
Getting DOS installed is a peice of cake, just reboot with install disk 1 inserted, and watch it go!
HOWEVER, setting up DOS Components like sound cards, a mouse, display, Modem, ect.can be pretty tricky, and thats a whole different story.Its not always automatically done like windows is. Hving the Correct drivers is a must as well, Generics dont work well, except for CD-ROMS.
DarthBrady
06-19-2006, 11:25 PM
How is DOS useful though? I mean what do you guys use it for?
DOS can be useful for a lot of stuff. For me, I use it Primarily to play DOS games that will not run under properly on WinXP. (Games Published by old companies like Sierra, Apogee, 3D Realms, Id, Interplay, ect.)
I cant live without DOS, I grew up playing games on CGA/EGA and that old PC speaker beepy music, before a ball mouse or a 3.5" floppy was ever common.
My first PC (in 1987) was an IBM ps/2 model. Check out its specs and behold the oldchool power!
it had:
Intel 15Mhz processor
4MB RAM
400MB Hard disk with a locking key
A 5 1/4" Giant floppy Drive
A 900 Baud modem (900 bytes per second max, not even 1KB!)
A 4 Paralell port keyboard (PS2 plugs didnt exist yet)
A keyboard that weighed 6 1/2 pounds.
A serial laser mouse (no ball) made of steel with aluminum laser mouse pad
A monitor with one color. GREEN
..ahh those were the days, after I got a new 16 color monitor!
Fierce Deity
06-19-2006, 11:29 PM
wow. I like my True Color 32-bit stuff wit the emulators and such. I'm thinking Ocarina of Time is better than bleeping metal games.
psilonaut
06-20-2006, 04:02 PM
...NOTE: DOS is only 100% compatible with pre-Windows 98 Pentium 3 Motherboards. You CAN make DOS rum on a pentium 3, but it is a LOT of manual labor, trust me I just did it to a AMD K7M 800Mhz board, and it was a bee-otch!
...
DOS will run on any X86 Architechture. Runs perfectly fine on my DFI Lanparty board...
DarthBrady
06-21-2006, 12:20 AM
DOS will run on any X86 Architechture. Runs perfectly fine on my DFI Lanparty board...
true it will run, i'm just saying it wasnt designed to run on aything newer than Pentium II MMX/AMD K7M Boards. I agree with you, but regardless, its much easier to configure on older boards. X86 and DFI will both run DOS, so will an old MAC PowerPC (a few models), but non of the were supported by microsoft for DOS use. See what I'm sayin?
Anyway, sorry CM for geting off topic in the middle of "class" ;)
Iconoclast
06-25-2006, 09:40 AM
I had a 16 color monitor! I was miserable. Windows 98, Tandy 16 color monitor, basic piece of ****. The screensavers all looked perversive. The best thing about the computer I had was that it wasn't indestructible so you could beat the crap out of it which I never did 'cause I was nice.
Iconoclast
06-25-2006, 01:17 PM
Don't tell them about using DOS to delete stuff. They don't need to know that, right, DarthBrady?
Pizzaman, DOS can be used to make batch files. Batch files can do things, such as deleting, installing, copying and pasting, moving, detecting software, and so on. If you're trying to help someone copy a file and they don't know how to do it, tell them to run a batch file you made. Mainly, DOS isn't really that useful today. Batch scripting is useful for automatically changing data on your hard disk every time you log on, cleaning up temporary files, and so on. But FD and CM want to know, and that is why I'm teaching it. It can also do things that are unique to other kinds of programming, which is what I'll get to here.
Open Windows Explorer or choose the My Computer option from your Start Menu (right pane). Browse to any directory on your hard disk. Right mouse-click the background of the directory you're browsing. Select the "New/New Text Document" command. Open the new file, and Notepad should open it. Now type this:
@ECHO OFF
ECHO Your first message here
ECHO_2
The "@ECHO OFF" part turns off command prompt feedback after every command unless unsuccessfully done. For example, if you use the COPY command to copy a file to a directory, DOS won't tell you that the file was copied successfully. It'll just do it if it can without giving any message. The "ECHO" command types messages in the command prompt. The "ECHO_2" tells DOS to load a file within the same directory as the file you're editing named ECHO_2.BAT, ECHO_2.COM, or ECHO_2.EXE.
Save changes to the file and close Notepad. Rename the file you saved to "ECHO_1.BAT". Create another new text document, and type the following:
@ECHO OFF
ECHO Your second message here
ECHO_1
Save changes to the file and close Notepad. Now rename this file "ECHO_2.BAT". Make sure that both files are in the same directory. Now open either file. They will infinitely reference each other, 'echoing' your message you typed in the second line of both files. They will never stop executing until you close the command prompt or press Ctrl+C. What my message was was the 'F' word in both batch files.
The two files you just created were called batch files. They are executables that can be created using Notepad, just like HTML web pages. They do everything you can type in the command prompt. If you choose the Run command from the right pane of your Start Menu and enter "cmd", the command prompt will start. If you type @ECHO OFF in the command prompt, it does what the batch files you made do. The batch files you made are merely files that execute multiple DOS commands as soon as you run them.
BTW, you can use the COPY command like this:
COPY [filepath] [destination directory]
EX: COPY C:\GAMES\QUEST_64.ZIP C:\GAMES\ROMS\N64
^Copies a file Quest_64.zip from C:\Games to C:\Games\ROMs\N64
Again, whether you type commands like this in the command prompt or in a text document renamed with a BAT extension and run the batch file, the same thing happens.
Iconoclast
06-25-2006, 01:28 PM
Oh, and pizzaman, DOS is useful for Flash programming as well. CM, I know you don't fully understand ActionScript yet, but here's an example:
fscommand("exec", "FRAPS.EXE");
The above ActionScript opens Fraps.exe from a subdirectory folder named "fscommand" (case-insensitive). In order for the "exec" command to work, you must have published an EXE of your Flash publication. If you run this command in an SWF version of the publication, nothing will happen. Also, you can't execute Word Documents like so:
fscommand("exec", "WordDocument.doc")
You can only execute file types that are executables. Executables have one of three file extensions: EXE, COM, or BAT. What you can do is this:
fscommand("exec", "WordDocument.bat")
And then configure the file WordDocument.bat like so:
WORDDO~1.DOC
The Flash application you published will run the batch file, and the batch file will open the Word Document. Had it not been for batch scripting, there would be no decent way to open files using Flash ActionScript.
This may not make sense, pizzaman, but if you are a Flash programmer, batch files can come in handy for opening external files.
Chickening out, again, I see. CM, you started this challenge. Are you forfeiting? Pizzaman's been here, and I don't see myself playing you both in chess.
psilonaut
06-25-2006, 02:43 PM
I had a 16 color monitor! I was miserable. Windows 98, Tandy 16 color monitor, basic piece of ****. The screensavers all looked perversive. The best thing about the computer I had was that it wasn't indestructible so you could beat the crap out of it which I never did 'cause I was nice.
Spoiled kids these days - I had a monochrome monitor on my Tandy
DarthBrady
06-25-2006, 09:05 PM
Don't tell them about using DOS to delete stuff. They don't need to know that, right, DarthBrady?
I hear ya bro. I hope the format/patition stuff wasnt to much then, but it is still essential to know for setting it up correctly.So here is something else useful, to help balance it out in the next post from me...
DarthBrady
06-25-2006, 09:21 PM
This will go over how to command DOS to make Copies or Backups of your Disks. Its can be pretty important in DOS, as there are no easy to use automatic restore Utlilites distributed with DOS. So Remember..
Back it UP Before You Screw it UP!! ;)
The "Diskcopy" command
This command is used to copy the contents of one disk, to another. Very simple and very handy.
Here's an example:
lets say you need to copy the contents of the disk in drive a: to a empty disk in drive b: . Just type the comman "diskcopy" followed by a space, the drive letter conatining data to be copied, another space, and the drive letter containing the empty space to copy the data to. It would look like this when typed at the command prompt:
DISKCOPY A: B:
(NOTE-remember any disk drive letter is always followed by a colon ":" symbol)
This only works with "comparable" or identical media types in DOS. For example, you CANNOT use this command to copy the contents of a 5.25" diskette to a 3.5" diskette. but you CAN copy a 3.5" to another 3.5", and so on.
You CANNOT use this to copy a floppy disk to or from a Hard Disk! for this you must use "copy" or "xcopy" commands, which will be explained in my next thread
vBulletin® v3.7.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.