forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Help file compiler - Internal DOS Commands

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code
View previous topic :: View next topic  
Author Message
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Mon Aug 05, 2002 1:17 pm    Post subject: Help file compiler - Internal DOS Commands Reply with quote

Another one for the DOS dinosaurs Wink This one compiles an HTML help file listing
the internal DOS commands for the system on which it is run.

Note: NT-based systems only, i.e. WinNT, Win2000, and WinXP.

Code:

TITLE Internal DOS commands help .. by Dr. Dread

%%batchfile = dummyx~x.bat
%%outfile = dummyx~x.txt
%%ver = @REGREAD(LOCAL,SOFTWARE\Microsoft\Windows NT\CurrentVersion,ProductName)
if @null(%%ver)
  info Wrong Windows version. "This programs runs on WinNT, Win2000, and WinXP."
  stop
end

DIALOG CREATE,"Internal DOS .. by Dr. Dread",-1,0,300,50
  dialog ADD,BUTTON,Go,12,60,,,Start
  dialog ADD,TEXT,txt,12,60,,,Running..
DIALOG SHOW
DIALOG HIDE,txt

:evloop
  wait event
  goto @event()
 
:GoBUTTON
DIALOG HIDE,Go
DIALOG SHOW,txt
LIST CREATE,1
LIST ADD,1,<HTML><HEAD>
LIST ADD,1,<TITLE>Help for %%ver internal DOS commands</TITLE>
LIST ADD,1,<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=ibm850'>
LIST ADD,1,</HEAD><BODY><A NAME='top'><CENTER><H2>Help for internal %%ver commands</H2>
list add,1,This file was generated using Visual DialogScript:<BR>
list add,1,<B>Script by Dr. Dread</B><BR></CENTER>
LIST ADD,1,<TABLE BORDER='0'>

LIST CREATE,2
LIST ADD,2,FOR /F @CHR(34)tokens=* delims=@CHR(34) "%%i IN ('HELP') DO @echo %%i" >> %%outfile
LIST SAVEFILE,2,%%batchfile
WAIT
RUN %%batchfile,WAIT
FILE DELETE,%%batchfile
LIST CLEAR,2
LIST LOADFILE,2,%%outfile
FILE DELETE,%%outfile

list create,3
list create,4

REM Check that the first item is not multi-line
%%point = @substr(@item(2),@pred(@len(@item(2))),)
if @equal(%%point,".")
  list seek,2,1
else
  list seek,2,2
end

repeat
%%line = @next(2)
%%command = @substr(%%line,1,@pred(@pos(" ",%%line)))
if @not(@equal(%%command," "))
  list add,3,%%command
  list add,1,<TR><TD><B><A HREF='#%%command'>%%command</A></B></TD><TD>@substr(%%line,10,@len(%%line))</TD></TR>
else
  list add,1,<TR><TD> </TD><TD>@substr(%%line,10,@len(%%line))</TD></TR>
end
until @equal(@index(2),@count(2))
list add,1,</TABLE>


list seek,3,0
list add,1,<BR> <HR>
repeat
%%comm2 = @next(3)
DIALOG set,txt,processing %%comm2
RUNH command.com /C HELP %%comm2 > dummyx~x,WAIT

list clear,4
list loadfile,4,dummyx~x
list add,1,<BR>&nbsp;<BR><A NAME=%%comm2><H3>%%comm2</H3>
list add,1,<PRE>
repeat
  list add,1,@next(4)
until @equal(@index(4),@count(4))
list add,1,</PRE>
list add,1,<A HREF=#top">Back to top</A>
until @equal(@index(3),@count(3))

list add,1,<CENTER><BR>
list add,1,This %%ver help file was generated using Visual DialogScript:<BR>
list add,1,<B>Script by Dr. Dread</B></CENTER></BODY></HTML>

list savefile,1,showcommands.html
FILE DELETE,dummyx~x
DIALOG set,txt,
info Done! Launching file in default browser.
shell open,showcommands.html

:CLOSE


EDIT: Check if the first item in command list is multiline.
Show a bit processing info

EDIT2: Better support for extended charsets in output.

Greetz
Dr. Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing


Last edited by Dr. Dread on Wed Jan 08, 2003 10:58 am; edited 2 times in total
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Mon Aug 05, 2002 1:57 pm    Post subject: Reply with quote

For those without NT based systems, you can view
command.com (DOS 7.0 or later) with DOS EDIT.COM
(or a hex editor) and see available DOS commands
and their use.

Or, if you know the command, you can type it along with
the "/?" switch to see usage. Example: dir /?

NOTE: Do NOT edit the command.com file...

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Mon Aug 05, 2002 2:48 pm    Post subject: Reply with quote

On a Dutch Windows version it works almost perfectly. Just in this version, the HELP
command starts with 2 description lines instead of one, so still something goes wrong:
Quote:
Typ HELP en de naam van de opdracht als u meer informatie over een specifieke
opdracht wilt.
ASSOC Bestandsassociaties weergeven en wijzigen
(...)


Because of this, it'll evaluate the word "opdracht" as a command while it doesn't really
exist.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Mon Aug 05, 2002 3:36 pm    Post subject: Reply with quote

Hi Tommy!

Thanks for the info. Made a little check to see if the first line of the commands list ends off
with a point. If not, the pointer is advanced by one.

Greetz
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Wed Jan 08, 2003 11:01 am    Post subject: Reply with quote

Small change to let extended characters in output be shown correctly in browser.

Greetz
Dr. Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group