Wednesday 30 July 2008

Batch programming: using help to help yourself

Nothing I know of can quite beat the Linux/Unix "man" pages but here's a quickie on how to use the help command from the Windows command prompt.

Step 1: start the prompt (Start -> Run -> (type) cmd -> Enter)

Step 2: type help

cmd> help

This displays a list of available batch commands.

Step 3: get help on command of your choice (e.g. "FOR")

cmd> help for


Reading all of this in black and grey is pretty tedious, so I have started on a script that will output all these command in HTML format. Run it once and it will create a folder containing:
- an link index to all the commands
- one page per command with the relevant details

I currently have two major problems with this:
1. Trailing "spaces": I can't seem to remove trailing spaces successfully (not even sure they really are spaces)
[EDIT: PROBLEM 1 SOLVED, shall post code tomorrow]
2. Accented characters: I am using French, and accented characters are output as anything but what they should be. For instance "é" is output ",", etc. and I have yet to find a full-DOS solution to this problem.
[EDIT: PROBLEM 2 SOLVED, shall post code tomorrow]

Any suggestions more than welcome regarding these two issues =)

No comments:

Online Marketing
Add blog to our blog directory blog search directory Blog Directory Blogarama - The Blog Directory