![]() |
Windows Command Line Switches |
- Information
- Address Book
- Compression Agent
- Control Panel
- Defrag
- Explorer
- HTML Help
- MkComp
- Regclean
- Regedit
- Scandskw
- Scanregw
- Sysedit
- Tuneup
- Winhelp
|
Please note that this list is for Windows 98 but most apply to ME as well and many will apply to newer versions
Although I show the full file name (e.g. wab.exe) you will normally be able to just use the file name without the extension (e.g. wab). Most switches can be preceded by either a dash (-) or a forward slash (/) but there must be a space between the program name (command) and the first switch. Click the appropriate tab to display the switches that can be used with that particular program. |
| Wab.exe switches | |
| wab.exe [/Open] [/New] [File Name] [Folder] [Folder Path] | |
|
<None> |
Opens the default address book. |
|
/Open |
Displays a dialog box to select an address book file |
|
/New |
Displays a dialog box to specify a new address book file |
|
/showexisting |
This one is still in question. I have no idea what the usage is. |
|
/[File name] |
Specifies the Address Book file to open. |
|
/[Folder] |
Displays a dialog box to select an address book file from the specified folder |
|
/[Folder Path] |
When the path to a folder is specified then a dialog will open to allow you to select the wab file that you want to open. |
| Compagent.exe switches | |
| Recompresses Drivespace 3 drives to achieve user specified level of compression | |
| cmpagent.exe [Drive] /All /N /Nop /Noio /Task /DatC:x /RCMP:x /Pmioctl /SageRun:x /SageSet:x | |
|
<none> |
Starts with a UI to set run and compression options. |
|
Drive |
Drive to compress |
|
/All |
Recompresses all drives |
|
/N |
|
|
/Nop |
Unattended mode; do not stop and display confirmation messages. |
|
/NoIO |
|
|
/Task:x |
|
|
/DatC:x |
|
|
/Rcmp:x |
|
|
/Pmioctl |
Turns off use of the protected-mode IOCTL from Drvspacx.vxd |
|
/SageRun:x |
Runs in unattended mode using the System Agent-aware settings in the SETn registry key |
|
/SageSet:x |
Display the System Agent-Aware Setting dialog box and store the settings in the SETn registry key |
| Run Control Panel Applets from the command line. | |
| control [applet] or just the applet (from the following list) --- To open a particular tab add a space, a comma and then the tab number (first is 0) | |
|
Control Panel Tool |
Applet |
|
Accessibility Options |
access.cpl |
|
Add New Hardware Wizard |
sysdm.cpl add new hardware |
|
Add/Remove Programs |
appwiz.cpl |
|
Date/Time Properties |
timedate.cpl |
|
Display Properties |
desk.cpl |
|
FindFast |
findfast.cpl |
|
Fonts Folder |
fonts |
|
Internet Properties |
inetcpl.cpl |
|
Joystick Properties |
joy.cpl |
|
Keyboard Properties |
main.cpl keyboard |
|
Microsoft Exchange (or Windows Messaging) |
mlcfg32.cpl |
|
Microsoft Mail Post Office |
wgpocpl.cpl |
|
Modem Properties |
modem.cpl |
|
Mouse Properties |
main.cpl |
|
Multimedia Properties |
mmsys.cpl |
|
Network Properties (Except NT4.0) |
netcpl.cpl |
|
Network Properties (NT4.0) |
ncpa.cpl |
|
Password Properties |
password.cpl |
|
PC Card (PCMCIA) |
main.cpl pc card |
|
Power Management (Windows 95) |
main.cpl power |
|
Power Management (Windows 98) |
powercfg.cpl |
|
Printers Folder /p> |
printers |
|
Regional Settings |
intl.cpl |
|
Scanners and Cameras |
sticpl.cpl |
|
Sound Properties |
mmsys.cpl sounds |
|
System Properties |
sysdm.cpl |
| Defrag.exe switches | |
| Defrag [Drive] /All /F /U /Q /P /Concise /Detailed /Noprompt /Pmioctl /Sageset:x /SageRun:x /Mwmem /Task:x | |
|
<nothing> |
Starts a UI to defragment drives |
|
Drive |
Drive to defrag (MUST include the colon) |
|
/All |
Defragment all local, non-removable drives. |
|
/F |
Defragment files and free space. |
|
/U |
Defragment files only. This leaves the spaces on the drive. |
|
/Q |
Defragment free space only. |
|
/P |
System and hidden files will be optimized. |
|
/Concise |
Display the Hide Details view (Default). |
|
/Detailed |
Display the Show Details view. |
|
/Noprompt |
Unattended mode; do not stop and display confirmation messages. |
|
/Pmioctl |
Turns off use of the protected-mode IOCTL from Drvspacx.vxd. |
|
/sageset:x |
Display the System Agent-Aware Setting dialog box and store the settings in the SETx registry key. |
|
/Sagerun:x |
Runs in unattended mode using the System Agent-aware settings in the SETx registry key. |
|
/MWMEM |
|
|
/TASK:x |
|
|
Defrag supports the command line options from Dos 6.22, however they appear not to do anything. | |
|
/B |
Restarts computer after Defrag completes. |
|
/SN |
Old sort by Name |
|
/SE |
Old sort by Extension |
|
/SD |
Old sort by Date |
|
/SS |
Old sort by Size |
|
/H |
Defrag hidden files |
|
/NOIO |
|
|
/RESCAN |
|
|
/CVF |
|
|
/NCD |
|
|
/DT |
|
|
HELP, SKIPHIGH, NOALTKEY |
|
|
BW, LCD, HERC, NOZOOM, G0, G1, G2 |
Old display and mouse options |
|
MULTITASK |
|
| Result Codes | |
|
0 |
Completed Successfully |
|
2 |
Unsuccessful; not enough free space |
|
3 |
The process was interrupted before completing |
|
4 |
Unsuccessful; drive contains errors |
|
5 |
Unsuccessful; error reading from drive |
|
6 |
Unsuccessful; error writing to drive |
|
9 |
Unsuccessful; not enough memory |
|
10 |
Unsuccessful; the drive was invalid |
|
15 |
Unsuccessful; disk was write-protected |
|
26 |
Unsuccessful; could not access drive |
|
105 |
Unsuccessful; drive was locked |
|
106 |
Unsuccessful; could not access drive |
|
108 |
Unsuccessful; could not access drive |
|
109 |
Unsuccessful; 32-bit compression driver not installed |
|
249 |
One or more drives could not be defragmented |
| Drivespace Progress | |
|
0%-4% |
Scaning the disk for errors |
|
5%-9% |
Reading the disk layout |
|
10% |
Optimizing programs (this takes the longest time) |
|
11%-100% |
Optimizing the rest of the disk |
|
Or if it's a Drivespace drive... |
|
|
11%-49% |
Optimizing the container file |
|
50%-100% |
Optimizing the Drivespace disk |
| Application Start Logs |
|
The program Taskmon.exe that is started by this registry key HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run logs how programs load into memory, storing the results in C:\Windows\Applog. The loading information on each file is stored in a file with the same name as the application main executable and an extension of lg and the letter of the drive (eg, lgc for a file on c drive). Defrag uses this to rearrange the program so the clusters are in the same order that the program loads, including other files that it loads. A log file C:\WINDOWS\Applog\OPTLOG.TXT details which programs have been Optimized, and why certain programs haven't been. It also lists the registry settings. To prevent Optimizing infrequent or useless programs (thus speeding up defragging or allowing more useful programs to be Optimized, as defrag will only Optimize the most frequent 50 programs) delete their *.lgc files. A tip is to run Winalign from the full Windows 98 Resource Kit and delete all *.lgc files in the applog directory, open and close all your main applications before running Defrag. |
| Registry Settings you can use a registry file to adjust these. |
|
REGEDIT4 ;To prevent screen savers from running during defragmentation. These are the keys for Defrag in Task Scheduler;This key is required for the settings button to appear in Task Scheduler |
| Error Messages | |
|
DEFRAG005 |
Unable to write sector |
|
DEFRAG006 |
Unable to read sector |
|
DEFRAG00205 |
Damaged Applog file. Delete all files in Windows\Applog folder |
| Explorer.exe | ||||
| explorer [/n] [/e][,/root,object][[,/select],subobject] | ||||
|
None |
Explorer rooted at the Desktop | |||
|
/n |
Opens a new window. | |||
|
/e |
Explorer View (default if nothing else is on the command line.) | |||
|
/root,object |
Starts Explorer with object the top item (normally Desktop is the top item). Eg: explorer /e,/root,c:\Starts Explorer with the C drive as the only drive available. | |||
|
/select,subobject |
Selects the specified subobject. | |||
|
Replaceable parameters are %1 (one) which is the short file or folder name and %l (L) which is the long file name. /IDLISTThis is an additional parameter that means a Windows internal structure is being passed. eg: Explorer.exe /e,/idlist,%I The %I is a replacable parameter representing an IDLIST. Rooted ViewsTo open an explorer item that starts with a special folder as the top folder use the following syntax. Where the special folder is a sub folder of the desktop explorer /e,root,::{CLSID of special folder}
Where the special folder is a sub folder of another special folder (usually, if not always My Computer) explorer /e,root,::{CLSID of parent}/::{CLSID of special folder}
Where the special folder is part of the file system explorer /e,root,path to folder See Namespaces on the Icons Page for a list of CLSIDs for special folders.
| ||||
| ||||
| hh.exe switches | |
| hh.exe [-decompile folder] [-mapid id] [-800] [-title text] helpfile | |
|
Decompile |
Decompiles all the original HTML files, graphics, stylesheets, contents, and index that make up a help file. Folder is the folder to decompile to. It only seems to work if the original files were only one folder deep. |
|
Mapid |
The topic to open |
|
800 |
Open help to a 800 x 600 window but without covering the taskbar (so its smaller than 800 x 600). It won't override a size set in the helpfile. |
|
Title |
Sets the window title to use. It won't override a title set in the helpfile. |
|
Helpfile |
CHM file to open |
| Make Compatible helps Windows 3.1 programs that won?t run under Windows 98 more compatible. It has no switches |
|
Mkcompat [filename] |
| RegClean cleans and repairs some registry errors. | |
| regclean [/v] [/a] | |
|
None |
Starts the Regclean wizard |
|
/a |
Doesn't prompt for user input |
|
/v |
Advanced User Interface |
|
/l |
Creates a log file |
|
Version 4.1 was withdrawn about September 1997, a new version 4.1a (Build 7364.1) was released 31/12/97.? Regclean was meant as a programers tool to remove entries from the registry that were put there during testing. Its unlikely to fix any reported registry problem. Regclean only works on HKEY_ROOT entries. It may fix problems with programs not working together, like embedding one file in another. It will remove out of date information about Automation objects and make the registry smaller. Its useful to remove information about programs that have been uninstalled. Regclean creates an Undo.reg file in the folder where you ran RegClean. The file will be titled UNDO computer yyyymmddhhmmss.REG. A similar program from Microsoft is ShareDLL. This cleans a different part of the registry, the SharedDLLs, that if it gets too big Setup programs will refuse to run. The key is; HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs Download ShareDLL.exe from Microsoft's web site | |
| Regedit.exe Imports and exports registry files to and from the registry. | |
MSDos ModeREGEDIT [/L:system] [/R:user] filename1 REGEDIT [/L:system] [/R:user] /C filename2 REGEDIT [/L:system] [/R:user] /E filename3 [regpath1] OSR 2 and later versions REGEDIT [/L:system] [/R:user] /D regpath2 Windows ModeREGEDIT [/S] filename1 | |
|
/L:system |
Specifies the location of the SYSTEM.DAT file. |
|
/R:user |
Specifies the location of the USER.DAT file. |
|
filename |
Specifies the file(s) to import into the registry. |
|
/C filename |
Specifies the file to create the registry from. |
|
/E filename |
Specifies the file to export the registry to. |
|
Regpath |
Specifies the starting registry key to export from. (Defaults to exporting the entire registry). |
|
/D regpath |
Deletes the specified registry key. |
|
/S |
Silent merge (no confirmation dialogs) |
Defragmenting the Registry (Win95 OSR2)In OSR 2 (9.5.0B) Regedit can be used to sort and compact the registry. Export the entire registry from Regedit in Windows, go to MS-Dos mode and recreate the directory using the /c parameter. This will not work properly in Win 95 950 or 950A, only 950B. In Windows 98 see Scanreg to defrag the registry (though the above will work). Changes to the registry aren't actually deleted, just marked as unused. This makes the registry larger than it needs to be. To sort and compact the registry; In Windows start Regedit and export [Registry Menu ? Export Registry File, make sure Export Range is set to all] the entire registry to a reg file in the windows directory called Full.reg. Exit to Dos Mode and at the C:\windows> prompt type regedit /L:system.dat /R:user.dat /C Full.reg Values stored in the registry with CR/LF won't be restored properly. The only key this affects on my machine is Outlook Express signature strings which are at least two lines. Might be a good idea to run regclean before this. Delete full.reg and the backed up system.dat and user.dat if it all works. Create New Defragmented RegistryREM Sample Batch File used to create new registry. REM Assumes that the exported file from Windows is called full.reg and REM is in the Windows directory. REM Assumes that User.dat is called that. Attrib ?r ?s ?h c:\windows\system.dat Attrib ?r ?s ?h c:\windows\user.dat Copy c:\windows\system.dat c:\windows\system.~da Copy c:\windows\user.dat c:\windows\user.~da regedit /L:c:\windows\system.dat /R:c:\windows\user.dat /C c:\windows\Full.reg Delete Backed Up FilesREM Sample Batch File to delete the backup files. REM Use after Windows has successfully restarted Del c:\windows\user.~da Del c:\windows\system.~da Del c:\windows\full.reg Restore Old RegistryREM Sample Batch File to restore previous Registry Attrib ?r ?s ?h c:\windows\system.dat Attrib ?r ?s ?h c:\windows\user.dat Copy c:\windows\system.~dat c:\windows\system.dat Copy c:\windows\user.~dat c:\windows\user.dat | |
| Scandskw.exe Runs the ScanDisk disk-repair program. | |
|
Scandskw should be used if you have disk problems and can still start Windows. There are two copies of the FAT on every disk. These track what parts of the disk the file is on. Where the beginning of the file starts is stored in the directory and the rest of it including the end is stored in the FAT. DOS and Windows only use the first FAT and copy it to the second as a backup. Scandisk only uses the first FAT to repair disks and copies it over the second after it repairs it. Scandskw uses both FATS to make repairs, using the best information from each. | |
| To check and repair a drive, use the following syntax:
Scandskw [Drive] [/Allfixeddisks] [/Noninteractive] [/Preview] [/Oldfs] [/Silent] [/Sageset:x] [/Sagerun:x] | |
|
[Drive] |
The drive or drives to test. (DO NOT include the colon) |
|
/Allfixeddisks |
Test all fixed disks. |
|
/Noninteractive |
Doesn't pause for additional user information. Displays summary screens. |
|
/Preview |
Test but doesn't fix any errors. |
|
/Oldfs |
Changes the File System to normal Dos. Removes all long file names. |
|
/Silent |
Exits without displaying summary screens. |
|
/Sageset:x |
Display the System Agent-Aware Setting dialog box and store the settings in the SETn registry key. |
|
/Sagerun:x |
Runs in unattended mode using the System Agent-aware settings in the SETn registry key. |
|
Scandskw is only a starter application. Dskmaint.dll does all the work. Registry SettingsScandskw stores it's settings under the following registry key. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\CheckDrive "Settings"=hex:nn,nn,nn,nn Where the numbers read from right to left. Add the numbers from the chart below using a calculator in hex mode, pad it out to 8 digits with leading zeros and reverse the result. | |
|
Type of test | |
|
Standard test |
&1 |
|
Through test |
&0 |
|
Automatically fix errors |
|
|
Areas of the disk to scan | |
|
Scan system & data areas |
&0 |
|
Scan system areas only |
&80 |
|
Scan data areas only |
&40 |
|
Do not perform write testing |
Not stored |
|
Do not repair sectors in hidden and system files |
&3 000 |
|
Display Summary | |
|
Always |
&0 |
|
Never |
&10 |
|
Only if errors found |
&40 000 |
|
Log file | |
|
Replace log |
&0 |
|
Append to log |
&10 000 000 |
|
No log |
&80 000 |
|
Cross linked files | |
|
Delete |
&4 000 |
|
Make copies |
&2 000 |
|
Ignore |
&0 |
|
Lost file fragments | |
|
Free |
&0 |
|
Convert to files |
&2 |
|
Check files for | |
|
(Don't check) Invalid file names |
&4 |
|
Invalid dates and times |
&8 |
|
Duplicate names |
&2 000 000 |
|
(Don't check) Check Host |
&2 000 |
|
Report MS-Dos mode name length errors |
&40 000 |
|
Can only be set in registry | |
|
Retest sectors marked bad. This is not a setting that should be used unless you have marked sectors bad accidentally. Normally sectors are marked bad because they are unreliable. |
&40 000 000 |
| Task Scheduler | |
|
This section tells Task Scheduler that Scandskw is a Task Scheduler aware program (it recognizes sageset and sagerun command line parameters). REGEDIT4[HKEY_LOCAL_MACHINE\Software\Microsoft\Plus!\SystemAgent\SAGE\Scandisk for Windows] These are the codes scandskw returns when it finishes running. Task Scheduler prints the string in schedlog.txt. [HKEY_LOCAL_MACHINE\Software\Microsoft\Plus!\SystemAgent\SAGE\Scandisk for Windows\Result Codes] ;This section is where the drives and options selected in the Task Scheduler Settings button are stored. The settings are the same as the table above. Set0 is the first Scandisk task in Task Scheduler, Set1 is the second, ect. [HKEY_LOCAL_MACHINE\Software\Microsoft\Plus!\SystemAgent\SAGE\Scandisk for Windows\Set0] Batch files can also use these codes. Scandisk returns the same error codes. If running Scandskw use. ;Start /w scandskw <command line parameters from the table above e.g. /all /non /nosummary>or if running scandisk use ;scandisk <command line parameters from the table above e.g. /all /autofix /nosummary> and on the following line use this test. The second errorlevel test should always be one higher than the first. If errorlevel 1 if not errorlevel 2 echo Errors found and all were fixed | |
| Scanregw.exe Backs up, restores, and repairs the registry. | |
|
Backs up, restores, and repairs the registry. Backups are saved with names RBnnn.CAB, eg: RB001.CAB, RB002.CAB There is also RBBAD.CAB which is the registry that won't boot. | |
|
<nothing> |
Checks the registry and asks if you want to back it up. |
|
RegistryFile |
The registry file to check. |
|
/Backup |
Backs up the registry |
|
/Restore |
Displays a message saying to run Scanreg in Dos mode. |
|
/Help |
Generates an error |
|
/? |
Generates an error |
|
/Scanonly |
Scans the registry for errors and displays an error message if any are found. |
|
/Autoscan |
Automatically scans the registry and backs it up without displaying any prompts if there is no backup for that date. |
|
/Autorun |
Windows Registry Checker automatically scans the system registry for invalid entries and empty data blocks when it is started. If invalid registry entries are detected, Windows Registry Checker automatically restores a previous day's backup. This is equivalent to running "scanreg /autorun" (without quotation marks) from a command prompt. If no backups are available, Windows Registry checker tries to make repairs to the registry. This is equivalent to running "scanreg /fix" (without quotation marks) from a command prompt. If the registry contains more than 500K of empty data blocks, Windows registry Checker automatically optimizes it. |
|
/Fix |
Displays a message saying to run Scanreg in Dos mode. |
|
"/Comment=Text" |
Adds a comment to a backup. This doesn't cause a backup to be created, but if one is created by another command line switch or the user choosing to backup then this comment will be added. |
| Ini Entries | |
| Sample Scanreg.ini file
Registry backup is skipped altogether if this is set to 0 Registry automatic optimization is skipped if this is set to 0 ScanregVersion=0.0001 Backup directory where the cabs are stored is \sysbckup by default. Entering a folder path overrides it. It must be a full path. ex. c:\tmp\backup BackupDirectory=c:\windows\sysbckup Files=[dir code,]file1,file2,file3 Files=[dir code,]file1,file2,file3 | |
| These are the settings that can be in the ini file. | |
|
ScanregVersion |
The Version of scanreg. |
|
Optimize |
A value of 1 (default) optimizes the registry if there is more than 500K blank space. |
|
MaxBackupCopies |
A value of 5 (default) saves the last 5 registry backups in the Windows\Sysbckup folder. This value can be between 0 and 99. |
|
BackupDirectory |
Default is Windows\Sysbckup. |
|
PickyRegScan |
Unknown, perhaps an extra thorough scan. |
|
Backup |
A value of 1 (default) causes a backup copy of your registry to be made the first time you start your computer on any given day (determined by the system clock). |
|
Files |
See Sample ini file above. |
|
If scanregw finds an error in the registry then it tell you it will restart the computer to start Scanreg so that it can restore or fix the registry. Scanreg is then started by Win.com with the /autorun parameter. | |
| Sysedit |
|
Opens common Windows initialization files for editing. The files include Autoexec.bat, Config.sys, Win.ini, System.ini, mail and networking initialization files. The maximum file size is 32 KB. Files edited are backed up with the .SYD extension. Sysedit |
| Tuneup.exe | |
| tuneup [/autorun] [/r] | |
|
<nothing> |
Starts with a UI to either run scheduled maintenance tasks or reconfigure them. |
|
/Autorun |
Run the scheduled maintenance tasks. |
|
/r |
Unknown but I'm working on it. |
| Winhlp32.exe the windows help program. | |
| Winhelp is used for running the older windows help files. Do not get this confused with hh.exe the compiled help executable | |
| winhlp32 [-g[n]] [-h] [-l topic-ID] [-k keyword] [-n context-No] [-p Popup-ID] [-w windowname] [filename] | |
|
<nothing> |
Starts Winhelp and displays the file open dialog box |
|
-G[n] |
Creates a configuration (.gid) file and quits. If a number is specified, it determines which extensible tab to display by default the first time the Help file is opened. A value of 1 would be the first tab beyond the Find tab. |
|
-h |
Displays the Winhlp32.hlp Help file. |
|
-i TopicID |
Displays the Help topic with the specified topic ID |
|
-k Keyword |
Displays the topic identified by the specified keyword |
|
-n ContextNo |
Displays the topic specified by the context number (defined in the [MAP] section of the project file) |
|
-p PopupID |
Displays the specified pop-up topic. You must use the -P switch in combination with the -I or -N switch, as shown in the following examples: |
|
-W WindowName |
Displays the topic in the specified window definition. |
|
filename |
Opens the helpfile filename |
| Keyboard navigation | |
|
Ctrl Shf Lft Arrow |
Next Topic |
|
Ctrl Shf Rght Arrow |
Prev Topic |
|
Ctrl Shf Home |
Beginning Of File |
|
Ctrl Shf End |
End Of File (Help Author Only) |
| Help Author adds other debugging commands to Win98 help files such as confirmation on jump and debug information. Right click the help pane to use them. You may have to add one of the following lines to your win.ini file in the [winhelp] section.
SeqTopicKeys=1 | |
| You can change the colors used in Winhelp by changing the following lines in the [winhelp] section of win.ini
JumpColor=0 0 128 The numbers represent the standard RGB color numbers where 0 is the lowest lowest value for a color and 255 is the highest. in the example above the Jump Color the color would be a medium blue. 0 red 0 green and 50% blue. | |

