Computing.Net > Forums > Programming > Help on Dos Commands in WinXP

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Help on Dos Commands in WinXP

Reply to Message Icon

Name: dtech10
Date: July 8, 2006 at 08:22:30 Pacific
OS: Win XP Pro
CPU/Ram: PIII 1Gb/1Gb
Comment:

This add to the registry please backup registry before using.
Save with vbs extension and click on the file.
Type h command ie. h dir to display dir syntax.
Type h ntcmds to display list of dos commands

---------------------
' Adds a registry entry that creates a Doskey macro in each command prompt session.
' The Doskey macro, called H, allows you to call up GUI help about commands.

Option Explicit
Dim intAllUsers, intOverWrite, strNewValue, strOldValue, strRegKey, WshShell

On Error Resume Next

intAllUsers = MsgBox ("Do you want to make the H (command-line help) macro available

to all users?", vbYesNoCancel, "Command-line Help")

Select Case intAllUsers
Case 6 'Yes (use HKLM)
strRegKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\Command

Processor\AutoRun"
Case 7 'No (use HKCU)
strRegKey = "HKEY_CURRENT_USER\Software\Microsoft\Command

Processor\AutoRun"
Case 2 'Cancel
WScript.Quit
End Select

Set WshShell = WScript.CreateObject("WScript.Shell")
strOldValue = WshShell.RegRead(strRegKey)

If strOldValue <> "" Then
intOverwrite = MsgBox ("The AutoRun key already contains the value '" &

strOldValue & "'" & vbNewLine & "Do you want to overwrite?", vbYesNo, "Command-line

Help")
If intOverWrite <> 6 Then WScript.Quit
End If

strNewValue = "doskey h=%systemroot%\pchealth\helpctr\binaries\helpctr /url

ms-its:%systemroot%\Help\ntcmds.chm::/$1.htm"
WshShell.RegWrite strRegKey, strNewValue, "REG_SZ"

Select Case intAllUsers
Case 6 ' Added to HKLM
WScript.Echo "The command-line help macro is now enabled in all new

command prompt windows."
Case 7 ' Added to HKCU
WScript.Echo "The command-line help macro is now enabled in all new

command prompt windows when logged on as the current user."
End Select



Sponsored Link
Ads by Google

Response Number 1
Name: tonysathre
Date: July 10, 2006 at 14:09:25 Pacific
Reply:

Thats not a batch file, its a VBSript. If your trying to run the script, you have to change the file extension to .vbs. Then just double click the icon or from the command line, use the wscript <filename.vbs> or cscript <filename.vbs>.

I have NOT lost my mind — I have it backed up on tape somewhere


0

Response Number 2
Name: dtech10
Date: July 10, 2006 at 16:06:20 Pacific
Reply:

Hi
I know it's a VBScript file and I said change the extension at the beginning.



0

Response Number 3
Name: tonysathre
Date: July 11, 2006 at 10:48:29 Pacific
Reply:

So what is your question? You want to know what it does?

I have NOT lost my mind — I have it backed up on tape somewhere


0

Response Number 4
Name: dtech10
Date: July 11, 2006 at 12:36:33 Pacific
Reply:

Hi
No it's a VBScript to help other people learn the MsdDos commands, maybe I did'nt explain very well.
If you save it with a vbs extension and double click on it, it allows you to type
"h MsDosCommand" at the command prompt to display the MsDos commands using Windows Help program.
ie "h dir", "h attrib" ect. or "h ntcmds" for a full list of commands.
I thought other people might find it usefull.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Help on Dos Commands in WinXP

Executing DOS commands in C++ www.computing.net/answers/programming/executing-dos-commands-in-c/6930.html

DOS commands in C www.computing.net/answers/programming/dos-commands-in-c/9449.html

run dos command in vb www.computing.net/answers/programming/run-dos-command-in-vb/121.html