JClark said:
Herb:
I tried to use this:
help >helpcmds.txt
for >for.txt
by putting it into notepad and saving it as a .cmd file. But it
doesn't seem to do anything. I get a lightning flash of the black cmd
screen and that's all. I'm sure it's just my ignorance about batch
programming in Win 2K. What am I missing?
Ok, but you need to develop a new habit -- run most of your
command files from a pre-existing Command prompt, then
when they finish the "black screen" will stay open and you can
read the results or issue another command to view the results,
etc.
In fact, do the following (on faith and make you own choices later):
First hit (or use your mouse):
Start(WinKey)\Run(R)\cmd <enter>
The key is to run "Cmd.exe" and get a command window open.
Now you have a command prompt and LEAVE IT OPEN FOREVER.
(until you reboot and open another one next time you boot.)
Second, let's make a better command prompt by Right-Clicking Properties:
Start\Programs\Accessories\Command Prompt <RIGHT CLICK>
Select Properties
On the various "Tabs" do these steps (leave the rest at defaults):
Short Tab \ShortCut Key -- Press Ctrl-Alt-d
(you can't really type, just press the sequence)
Options Tab: QuickEdit mode CHECK, Insert Mode CHECK
Discard old duplicates CHECK, Window SELECTED
Layout Tab-- Screen Buffer Size HEIGHT 2300 if you have tons
of RAM, at least 1000 (2300 because I just type a "2" in front
of the default "300")
Window Size Height = 30, 35, 45 depending what just fits
comfortably on YOUR screen, or leave it at the default 25
Color Tab -- Screen Background Dark Blue (on the left near black)
Screen text -- Bright Yellow (in the right near the white)
Say Ok and save it all.
What did we do? We got you a nice scroll back buffer (1000+ lines),
quickedit for mouse selection, colors that are easier on the eyes (and
more attractive) plus they signal you that YOU setup this prompt and
are not using the defaults, more lines on the screen (less backscrolling
needed), AND a "short cut" key to bring this up.
Ok, get back to the prompt Start\Programs\Accessories and select
that Command Prompt and HOLD CONTROL while dragging it
to the "quick launch" bar near the "Start" button. Release.
Now you have a "quick launch" to this "command prompt" you setup.
Also try this: Ctrl-Alt-d
If it pops up automatically then you setup the "hotkey" correctly.
Why "d"? Had to pick something and "d" stands for DOS which reminds
ME of the "dos prompt" (Note: It isn't really a "dos" prompt but a lot
of people call it that and one Icon Microsoft used to use had MSDOS on
it.)
Ok, now use your command prompt -- change to the root of the C: drive
if necessary "cd /d C:\" -- do this manually -- the /d just makes sure if
you
are on the D: or E: you will also change "drives" and not just
subdirectories.
Now make yourself a "bat" directory -- md c:\bat
Make a habit of keeping your "batch files" in here. You could also name
it "C:\cmd" but those of us who have been doing this for years (before .CMD
files) tend to call it C:\bat.
Now if you keep you batch files together here, you can always find them
by going there from the command prompt or opening them there with Notepad
etc.
You might wish to also (at some point) add this directory to your PATH.
(We will explain that later if you don't know how -- it's in the System
Control
panel Advanced though.)
Change to your batch directory: cd /d c:\bat
Now MANUALLY run the commands I gave you (there):
help >helpcmds.txt
for /? >for.txt
Now do a "dir" and you should see your two text files (stay in the
habit of running from the command line and avoid Explorer until
you get good at this.)
Type the name of (each of) the files, one at a time and with look
Notepad will open:
C:\> helpcmds.txt
C:\> for.txt
This works because of the file extension association between .TXT
and notepad -- and because of this you MUST type the whole name
to "run a textfile". For EXEs and CMD files you can usually omit the
extension but to "run the application for a document by association"
you must type the whole thing.
Enjoy.
By the way, what is windows 2003?
The NEXT version of Windows 2000 or Windows XP.
Technically Win2000 is just NT 5.0, WinXp is 5.1, and Win2000 Server
is 5.2
Sure...too few people know how to use the command line and also how
to write batch files.
Remember MOST things you can type at the command prompt work
in batch files and vice versa (there are a few MINOR differences and
there are obviously some commands for batch files that make little sense
when run interactively.)