home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Unsorted BBS Collection
/
thegreatunsorted.tar
/
thegreatunsorted
/
programming
/
misc_programming
/
doshints.doc
< prev
next >
Wrap
Text File
|
1995-01-18
|
3KB
|
76 lines
Here are a few hints for batch files and DOS that I have aquired over the
years that might be helpful....
1. Erasing all files within a directory isn't fun. Not only do you have to
type 'erase *.*', which takes time playing with that shift key, but you
also have to wait for the 'are you sure?' prompt. Well, there's only
two other ways I know of, to clear your directory. 1> is to step back a
path and deltree the directory, then 'MD' it again, or 2> (the easy way)
Write a small batch file to erase all files and do the prompt thing.
Did you know, that you don't have to type 'erase *.* ' or 'del *.*'.
All you need to type is 'erase.' or del.'. Besure not to put a space
before the period. O.K. here is my solution to this problem.. I call it
'KILL.BAT'.. Find a directory somewhere in the path and type:
'COPY CON KILL.BAT' the cursor will automatically carrige return, and
there it will wait for input.. Just type these few lines:
@ECHO OFF
ECHO Y|ERASE. > NUL
AFTER YOU PRESS RETURN ON THE SECOND LINE, PRESS CONTROL AND Z TOGETHER.
YOU'LL SEE THE THIRD LINE AS:
^Z
Press enter and you'll see '1 file copied'. That means you did it right.
From then on, anytime you want to delete the contenst of a directory,
fast and easy, just type 'KILL'.
2. How about reading a directory? Pretty simple, right? just type 'dir' and
there you have it.. Well, what if some program, or someone attribed some
files within that directory as hidden files. They won't show up with
just 'dir'. ...and, yes, you could type 'dir /a:h' actually you don't
even need the colon. you could type 'dir /ah' and see the hidden files.
Well what if there was an easy way to view all files within a directory,
no matter what attributes they might have. It's easy... just type:
'DIR,' Again besure that there is no space.
3. How about updating the date/time stamp on a file within your directory.
just type:
'COPY FILENAME.EXT/B+,,/Y'
Unfortunatly, this doesn't seem to work with multiple files, but so you
don't have to keep typing this large command, you could make a simple
batch file to simplify it. Example:
COPY CON STAMP.BAT
@ECHO OFF
COPY %1/B+,,/Y
^Z
Don't forget to place .bat files like these in a directory within the
path...
4. Okay, last one. A simple file locator program that will scan your HD
for a specific file or files.
COPY CON LOCATE.BAT
EHCO.
ECHO SCANNING HARD DRIVE FOR "%1"
DIR C:\%1 /S /B /P
ECHO.
ECHO SEARCH COMPLETE.
ECHO.
^Z
THE /S COMMAND STEPS UP ALL SUBDIRECTORIES, AND THE /P PAUSES FOR
MULTIPLE FILE LISTINGS, BUT WHAT I AM IMPRESSED WITH IS THE /B COMMAND.
IT WILL DISPLAY THE DRIVE PATH AND FILE NAME SO YOU KNOW EXACTLY WHERE
YOU NEED TO GO TO FIND IT. i.e. C:\GAMES\DOOM\DOOM.WAD
IF ANY OF THESE TIPS ARE NEW TO YOU, AND ARE HELPFUL, THEN MY TIME I
SPENT TYPING ALL THIS OUT, WON'T BE FOR NOTHING... IF NOT....
D A M N !