• Advertisement

Archived

This topic is now archived and is closed to further replies.

How do I use DOS?

This topic is 6246 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How do you enter commands and create directory folders in DOS prompt? I have no idea how to use the damn thing. HELP ME OUT! I have GNU C++ but I can't use it without knowing this. Edited by - Some Guy on January 11, 2001 1:39:32 AM

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by Some Guy
How do you enter commands and create directory folders in DOS prompt? I have no idea how to use the damn thing.



''Nother poor Windows user........
You enter commands using ''the keyboard''

some basic commands:

md (make directory) as in md foobar
cd (change directory) as in cd foobar
copy (well DUH) as in copy foobarsource.txt foobar\foobardest.txt
del (delete) as in del *.* (deletes everything in current directory)
rd (remove directory) only works if the directory is empty
dir (directory ) shows the contents of a directory

Gyzmo
=======================
Meddle not in the affairs of dragons for you are crunchy and go well with toast.

Share this post


Link to post
Share on other sites
Also, you can type /? after a command for more information about it.

"dir/w/p" is also very handy if you want to see the directory contents instead of let it flying by...

Share this post


Link to post
Share on other sites
dir/w/o/p is even better though

Also, mkdir & rmdir work if you forget how to command change between dos and linux

dir filename.ext will find the file you want in the current folder (or at least say if it''s there)
While dir filename.ext /s will look in the subdir''s

find works like windows ''find file with text'', only much slower (can be used to find reference code or sumptin..)

That, and what the others said (although less what i just wrote), should be about all you need

eh?

Share this post


Link to post
Share on other sites
Completely irrelevant but Win2k (not sure if it''s just the server edition) uses *nix commands. Found that out by accident when I typed ls instead of dir. I found this really cool.. so now I no longer use the Windows stuff.

Share this post


Link to post
Share on other sites
wop

I''d like to add that it''s also possible to show one file type..

ie.

dir *.exe <- shows all executables in the directory
dir *.* <- shows all files
dir blah*.exe <- shows all executables beginning with blah

Share this post


Link to post
Share on other sites
Typing "help" should list all commands (I don't know whether this works in the DOS prompt of Win9x/NT though - it works fine on Win2k on my machine)

If you want to save this information as a file, type "help > help.txt". The greater-than symbol redirects output to a file.

To get help on a specific command type "help command " or use the /? switch as richardve said.

Other useful tips:

"cd .." moves you up one directory.

If you get a message like 'someprogram' is not recognized as an internal or external command, operable program or batch file. but you know the program exists then you need to change directory to where the program exists and run it from there, or, if you want to use the program from any directory, add the program's directory to the PATH environment variable.

If you find you are repeatedly having to type a series of commands, such as:

compile myprogram.c
link myprogram.obj mylib.lib
...etc...

then learn how to make batch files. These are just text files with a .bat extension containing a series of commands. You can run a batch file and pass it parameters. For the above example you could create a batch file called "docompile.bat" which would look like this:

compile %1.c
link %1.obj %2.lib
...etc...

Instead of typing all the commands every time you wanted to compile and link a program, you can just type "docompile myprogram mylib". The %1 and %2 in the batch file will be replaced by the first and second parameters after the docompile command.

Edited by - Moot on January 11, 2001 11:45:16 AM

Share this post


Link to post
Share on other sites
quote:

dir *.* <- shows all files



Well, not quite... It lists all files containing a dot ('.'). dir * lists all files. Sorry to be so pedantic

Edited by - Muzzafarath on January 11, 2001 12:14:05 PM

Share this post


Link to post
Share on other sites
Nope, the help command is gone under win9x!
(It does exist under DOS 6.22)


cd.. <- move up 1 directory (like Moot already said..)
cd... <- move up 2 directories
cd.... <- move up 3 directories (etc, etc)


NOTE: the "...." thing does only work under win2K (console)

Share this post


Link to post
Share on other sites
quote:
Original post by Muzzafarath

[ quote ]
dir *.* <- shows all files
[ /quote ]

Well, not quite... It lists all files containing a dot ('.'). dir * lists all files. Sorry to be so pedantic

Edited by - Muzzafarath on January 11, 2001 12:14:05 PM




Almost all files than..

Edited by - richardve on January 11, 2001 12:22:19 PM

Share this post


Link to post
Share on other sites
quote:
Original post by Muzzafarath

[quote]
dir *.* <- shows all files



Well, not quite... It lists all files containing a dot (''.''). dir * lists all files. Sorry to be so pedantic

Edited by - Muzzafarath on January 11, 2001 12:14:05 PM

you''re completely wrong. dir *.* will print all the files not just the ones with (''.'').





Cyberdrek
Headhunter Soft
DLC Multimedia

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
*.* will show all files * directories.
*. will generally show all directories
* is the same as *.*

Share this post


Link to post
Share on other sites
If you''re running some version of NT, remember to use cmd.exe and not command.com since it will be slow as hell...

Share this post


Link to post
Share on other sites
dir /ad shows all directorys
dir /a-d shows files
dir /ah shows hidden files
dir /os shows files in size order
and so on

Share this post


Link to post
Share on other sites
Yeah, command.com runs horribly in 2K, but cmd.exe is nice and fast . How come my Win2K DOS prompt can''t use Unix/Linux commands, darn it!

Also, along with the normal commands you can use redirects, like this:

dir *.*>file.txt (Send directory contents to file.txt)
dir *.txt>COM1 (Send a list of all text files in the directory to COM Port 1)
dir *.txt>LPT1 (Same as above except to Printer Port 1)
dir *.*>NUL (Yeah, they spell null with only one L. Send the contents of the directory to no where )

Have fun with that =P. Here''s some more DOS commands you can have some fun with:

ASSOC Displays or modifies file extension associations
AT Schedules commands and programs to run on a computer.
ATTRIB Displays or changes file attributes.
BREAK Sets or clears extended CTRL+C checking.
CACLS Displays or modifies access control lists (ACLs) of files.
CALL Calls one batch program from another.
CD Displays the name of or changes the current directory.
CHCP Displays or sets the active code page number.
CHDIR Displays the name of or changes the current directory.
CHKDSK Checks a disk and displays a status report.
CHKNTFS Displays or modifies the checking of disk at boot time.
CLS Clears the screen.
CMD Starts a new instance of the Windows 2000 command interpreter.
COLOR Sets the default console foreground and background colors.
COMP Compares the contents of two files or sets of files.
COMPACT Displays or alters the compression of files on NTFS partitions.
CONVERT Converts FAT volumes to NTFS. You cannot convert the
current drive.
COPY Copies one or more files to another location.
DATE Displays or sets the date.
DEL Deletes one or more files.
DIR Displays a list of files and subdirectories in a directory.
DISKCOMP Compares the contents of two floppy disks.
DISKCOPY Copies the contents of one floppy disk to another.
DOSKEY Edits command lines, recalls Windows 2000 commands, and creates macros.

ECHO Displays messages, or turns command echoing on or off.
ENDLOCAL Ends localization of environment changes in a batch file.
ERASE Deletes one or more files.
EXIT Quits the CMD.EXE program (command interpreter).
FC Compares two files or sets of files, and displays the differences
between them.
FIND Searches for a text string in a file or files.
FINDSTR Searches for strings in files.
FOR Runs a specified command for each file in a set of files.
FORMAT Formats a disk for use with Windows 2000.
FTYPE Displays or modifies file types used in file extension associations.
GOTO Directs the Windows 2000 command interpreter to a labeled line in a
batch program.
GRAFTABL Enables Windows 2000 to display an extended character set in graphics
mode.
HELP Provides Help information for Windows 2000 commands.
IF Performs conditional processing in batch programs.
LABEL Creates, changes, or deletes the volume label of a disk.
MD Creates a directory.
MKDIR Creates a directory.
MODE Configures a system device.
MORE Displays output one screen at a time.
MOVE Moves one or more files from one directory to another directory.
PATH Displays or sets a search path for executable files.
PAUSE Suspends processing of a batch file and displays a message.
POPD Restores the previous value of the current directory saved by PUSHD.
PRINT Prints a text file.
PROMPT Changes the Windows 2000 command prompt.
PUSHD Saves the current directory then changes it.
RD Removes a directory.
RECOVER Recovers readable information from a bad or defective disk.
REM Records comments (remarks) in batch files or CONFIG.SYS.
REN Renames a file or files.
RENAME Renames a file or files.
REPLACE Replaces files.
RMDIR Removes a directory.
SET Displays, sets, or removes Windows 2000 environment variables.
SETLOCAL Begins localization of environment changes in a batch file.
SHIFT Shifts the position of replaceable parameters in batch files.
SORT Sorts input.
START Starts a separate window to run a specified program or command.
SUBST Associates a path with a drive letter.
TIME Displays or sets the system time.
TITLE Sets the window title for a CMD.EXE session.
TREE Graphically displays the directory structure of a drive or path.
TYPE Displays the contents of a text file.
VER Displays the Windows 2000 version.
VERIFY Tells Windows 2000 whether to verify that your files are written
correctly to a disk.
VOL Displays a disk volume label and serial number.
XCOPY Copies files and directory trees.


Straight from the help command =P.




http://www.gdarchive.net/druidgames/

Share this post


Link to post
Share on other sites
quote:
Original post by Cyberdrek
you''re completely wrong. dir *.* will print all the files not just the ones with (''.'').



That seems very odd to me but I''ll take your word for it...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by Tbach

Completely irrelevant but Win2k (not sure if it''s just the server edition) uses *nix commands. Found that out by accident when I typed ls instead of dir. I found this really cool.. so now I no longer use the Windows stuff.



My win2k pro does not respond to *nix commands, oh well, back to my old Win98 batch files to emulate them.

Share this post


Link to post
Share on other sites
cd\ can be very helpful, also deltree !

cya,
Phil

Visit Rarebyte!
and no!, there are NO kangaroos in Austria (I got this questions a few times over in the states

Share this post


Link to post
Share on other sites

  • Advertisement