Showing posts with label Command Syntax. Show all posts
Showing posts with label Command Syntax. Show all posts

Tuesday, November 22, 2011

More (Recovery Console)

What is the More Command?:

The more command is a Recovery Console command used to display the contents of a text file on your computer screen.
The more command can be used interchangeably with the type command.
A more command is also available from the Command Prompt.

More Command Syntax:

more [drive:][path] filename
drive = This is the drive letter that contains the filename.
path = This is the folder or folder path that contains the filename.
filename = This is the name of the text file that you want to display the contents of on screen.

More Command Examples:

more kb885835.log
In the above example, typing the more command followed by the kb885835.log file name will show the contents of the file on screen.
Since I didn't give any drive: or path information, the more command will display the contents of the kb885835.log file that's contained in the folder that I happen to be in.
more c:\windows\system32\spupdwxp.old
In this example, the more command is used to show the contents of the spupdwxp.old file located in the c:\windows\system32 folder.

How To Read Command Syntax

The syntax of a command is basically the rules for running the command. You need to know how to read syntax notation when learning how to use a command so you can use it properly.
As you've probably seen on my site and maybe others, Command Prompt commands, DOS commands, and even many run commands are described with all sorts of slashes, brackets, italics, etc. Once you know what all of those marks refer to, you can look at any command's syntax and know right away what options are required and what options can be used with what other options.
Note: Depending on the source, you might see slightly different syntax when used to describe commands. I used a method that Microsoft has historically used but all command syntax that I've every seen on any site is extremely similar to what I use.
The Command Syntax Key at the bottom of the page describes how each notation in a command's syntax is to be used so feel free to reference it as we walk through three examples:
Example #1: Vol Command
vol [drive:]
This is the syntax for the vol command, a command available from the Command Prompt in all versions of the Windows operating system.
The word vol is in bold, meaning that it should be taken literally. It's also outside of any brackets, meaning it's required. We'll take a look at brackets a few paragraphs down.
Following vol is a space. Spaces in a command's syntax are to be taken literally so when you're executing the vol command, you will need to put a space between vol and anything that might come next.
Brackets indicate that whatever is contained inside them is optional - whatever is in there is not required for the command to function but might be something you want to use, depending on what you're using the command for. Brackets are never to be taken literally so never include them when executing a command.
Inside the brackets is the italicized word drive, followed by a colon in bold. Anything italicized is something you must supply, not take literally. In this case, drive is referring to a drive letter so you'll want to supply a drive letter here. Just as with vol, since : is in bold, it should be typed as shown.
Based on all of that information, here are some valid and invalid ways to execute the vol command and why:
vol
Valid: The vol command can be executed by itself because drive: is optional because it's surrounded with brackets.
vol d
Invalid: This time, the optional part of the command is being used, specifying drive as d, but the colon was forgotten. Remember, we know the colon accompanies the drive because it is included in the same set of brackets and we know it should be used literally because it's bold.
vol e: /p
Invalid: The /p option wasn't listed in the command syntax so the vol command does not run when using it.
vol c:
Valid: In this case, the optional drive: argument was used just as intended.
Example #2: Shutdown Command
shutdown [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f] [/m \\computername] [/t xxx] [/d [p:|u:]xx:yy] [/c "comment"]
The syntax listed above for the shutdown command is obviously much more complex than in the first example but building on what you already know, there's actually very little more to learn here.
Remember that items within brackets are always optional, items outside of brackets are always required, bold items and spaces are always literal, and italicized items are to be provided by you.
The big new concept in this example is the vertical bar. Vertical bars within brackets indicate optional choices. So in the example above, you can, but don't have to, choose to include one of the following options when executing a shutdown command: /i, /l, /s, /r, /g, /a, /p, /h, or /e. Like brackets, vertical bars exist to explain command syntax and are not to be taken literally.
The shutdown command also has a nested option in [/d [p:|u:]xx:yy] - basically, an option within an option.
Like with the vol command in Example #1 above, here are some valid and invalid ways to use the shutdown command:
shutdown /r /s
Invalid: The /r and /s options can not be used together. These vertical bars indicate choices, of which you can choose only one.
shutdown /s p:0:0
Invalid: Using /s is perfectly fine but the use of p:0:0 is not because this option is available only within the /d option, which I forgot to use. The correct usage would have been shutdown /s /d p:0:0.
shutdown /r /f /t 0
Valid: All options were used correctly this time. The /r option was not used with any other choice within its set of brackets, and the /f and /t options were used as described in the syntax.
Example #3: Net Use Command
net use [{devicename | *}] [\\computername\sharename [{password | *}]] [/persistent:{yes | no}] [/savecred] [/delete]
For our final example, let's look at the net use command, one of the net commands. The net use command syntax is a little messy so I've abbreviated it to make explaining it a bit easier. You can see the full syntax here.
The net use command has two instances of a new notation, the brace. A brace indicates that one, and only one, of the choices, separated by one or more vertical bars, is required. This is unlike the bracket with vertical bars that indicates optional choices.
Let's look at some valid and invalid uses of net use:
net use e: * \\server\files

Invalid: The first set of braces mean that you can specify a devicename or use the wildcard character * - you can't do both. Either net use e: \\server\files or net use * \\server\files would have been valid ways to execute net use in this case.
net use * \\appsvr01\source 1lovet0visitcanada /persistent:no

Valid: I correctly used several options in this execution of net use, including one nested option. I used the * when required to choose between it and specifying a devicename, I specified a share [source] on a server [appsvr01], and then chose to specify a {password} for that share, 1lovet0visitcanada, instead of forcing net use to prompt me for one {*}. I also decided not to allow this new shared drive to be automatically reconnected next time I start my computer [/persistent:no].
net use /persistent
Invalid: In this example, I chose to use the optional /persistent switch but I forgot to include the colon next to it and also forgot to choose between the two required options, yes or no, between the braces. Executing net use /persistent:yes would have been a valid use of net use.

Command Syntax Key

Notation Meaning
Bold Bold items must typed exactly as they are shown, this includes any bold words, slashes, colons, etc.
Italic Italic items are items that you must supply. Do not take an italic item literally and use it in the command as shown.
S p a c e s All spaces should be taken literally. If a command's syntax has a space, use that space when executing the command.
[Text inside brackets] Any items inside a bracket are optional. Brackets are not to be taken literally so don't use them when executing a command.
Text outside brackets Any text not contained in a bracket is required. In the syntax of many commands, the only text not surrounded by one or more brackets is the command name itself.
{Text inside braces} The items within a brace are options, of which you must choose only one. Braces are not to be taken literally so don't use them when executing a command.
Vertical | bar Vertical bars are used to separate items within brackets and braces. Do not take vertical bars literally - do not use them when executing commands.
Ellipsis ... An ellipsis means that an item can be repeated indefinitely. Do not type ellipsis literally when executing a command and take care to use spaces and other required items as shown when repeating items.


Note: Brackets are also sometimes referred to as square brackets, braces are sometimes referred to as squiggly brackets or flower brackets, and vertical bars are sometimes called pipes, vertical lines, or vertical slashes. Regardless what you call them, none should ever be taken literally when executing a command.

Monday, March 22, 2010

All windows shortcuts - exclusive



Command Prompt:
ANSI.SYS Defines functions that change display graphics, control cursor movement, and reassign keys.
APPEND Causes MS-DOS to look in other directories when editing a file or running a command.
ARP Displays, adds, and removes arp information from network devices.
ASSIGN Assign a drive letter to an alternate letter.
ASSOC View the file associations.
AT Schedule a time to execute commands or programs.
ATMADM Lists connections and addresses seen by Windows ATM call manager.
ATTRIB Display and change file attributes.
BATCH Recovery console command that executes a series of commands in a file.
BOOTCFG Recovery console command that allows a user to view, modify, and rebuild the boot.ini
BREAK Enable / disable CTRL + C feature.
CACLS View and modify file ACL's.
CALL Calls a batch file from another batch file.
CD Changes directories.
CHCP Supplement the International keyboard and character set information.
CHDIR Changes directories.
CHKDSK Check the hard disk drive running FAT for errors.
CHKNTFS Check the hard disk drive running NTFS for errors.
CHOICE Specify a listing of multiple options within a batch file.
CLS Clears the screen.
CMD Opens the command interpreter.
COLOR Easily change the foreground and background color of the MS-DOS window.
COMP Compares files.
COMPACT Compresses and uncompress files.
CONTROL Open control panel icons from the MS-DOS prompt.
CONVERT Convert FAT to NTFS.
COPY Copy one or more files to an alternate location.
CTTY Change the computers input/output devices.
DATE View or change the systems date.
DEBUG Debug utility to create assembly programs to modify hardware settings.
DEFRAG Re-arrange the hard disk drive to help with loading programs.
DEL Deletes one or more files.
DELETE Recovery console command that deletes a file.
DELTREE Deletes one or more files and/or directories.
DIR List the contents of one or more directory.
DISABLE Recovery console command that disables Windows system services or drivers.
DISKCOMP Compare a disk with another disk.
DISKCOPY Copy the contents of one disk and place them on another disk.
DOSKEY Command to view and execute commands that have been run in the past.
DOSSHELL A GUI to help with early MS-DOS users.
DRIVPARM Enables overwrite of original device drivers.
ECHO Displays messages and enables and disables echo.
EDIT View and edit files.
EDLIN View and edit files.
EMM386 Load extended Memory Manager.
ENABLE Recovery console command to enable a disable service or driver.
ENDLOCAL Stops the localization of the environment changes enabled by the setlocal command.
ERASE Erase files from computer.
EXIT Exit from the command interpreter.
EXPAND Expand a M*cros*ft Windows file back to it's original format.
EXTRACT Extract files from the M*cros*ft Windows cabinets.
FASTHELP Displays a listing of MS-DOS commands and information about them.
FC Compare files.
FDISK Utility used to create partitions on the hard disk drive.
FIND Search for text within a file.
FINDSTR Searches for a string of text within a file.
FIXBOOT Writes a new boot sector.
FIXMBR Writes a new boot record to a disk drive.
FOR Boolean used in batch files.
FORMAT Command to erase and prepare a disk drive.
FTP Command to connect and operate on a FTP server.
FTYPE Displays or modifies file types used in file extension associations.
GOTO Moves a batch file to a specific label or location.
GRAFTABL Show extended characters in graphics mode.
HELP Display a listing of commands and brief explanation.
IF Allows for batch files to perform conditional processing.
IFSHLP.SYS 32-bit file manager.
IPCONFIG Network command to view network adapter settings and assigned values.
KEYB Change layout of keyboard.
LABEL Change the label of a disk drive.
LH Load a device driver in to high memory.
LISTSVC Recovery console command that displays the services and drivers.
LOADFIX Load a program above the first 64k.
LOADHIGH Load a device driver in to high memory.
LOCK Lock the hard disk drive.
LOGON Recovery console command to list installations and enable administrator login.
MAP Displays the device name of a drive.
MD Command to create a new directory.
MEM Display memory on system.
MKDIR Command to create a new directory.
MODE Modify the port or display settings.
MORE Display one page at a time.
MOVE Move one or more files from one directory to another directory.
MSAV Early M*cros*ft Virus scanner.
MSD Diagnostics utility.
MSCDEX Utility used to load and provide access to the CD-ROM.
NBTSTAT Displays protocol statistics and current TCP/IP connections using NBT
NET Update, fix, or view the network or network settings
NETSH Configure dynamic and static network information from MS-DOS.
NETSTAT Display the TCP/IP network protocol statistics and information.
NLSFUNC Load country specific information.
NSLOOKUP Look up an IP address of a domain or host on a network.
PATH View and modify the computers path location.
PATHPING View and locate locations of network latency.
PAUSE Command used in batch files to stop the processing of a command.
PING Test / send information to another network computer or network device.
POPD Changes to the directory or network path stored by the pushd command.
POWER Conserve power with computer portables.
PRINT Prints data to a printer port.
PROMPT View and change the MS-DOS prompt.
PUSHD Stores a directory or network path in memory so it can be returned to at any time.
QBASIC Open the QBasic.
RD Removes an empty directory.
REN Renames a file or directory.
RENAME Renames a file or directory.
RMDIR Removes an empty directory.
ROUTE View and configure windows network route tables.
RUNAS Enables a user to execute a program on another computer.
SCANDISK Run the scandisk utility.
SCANREG Scan registry and recover registry from errors.
SET Change one variable or string to another.
SETLOCAL Enables local environments to be changed without affecting anything else.
SETVER Change MS-DOS version to trick older MS-DOS programs.
SHARE Installs support for file sharing and locking capabilities.
SHIFT Changes the position of replaceable parameters in a batch program.
SHUTDOWN Shutdown the computer from the MS-DOS prompt.
SMARTDRV Create a disk cache in conventional memory or extended memory.
SORT Sorts the input and displays the output to the screen.
START Start a separate window in Windows from the MS-DOS prompt.
SUBST Substitute a folder on your computer for another drive letter.
SWITCHES Remove add functions from MS-DOS.
SYS Transfer system files to disk drive.
TELNET Telnet to another computer / device from the prompt.
TIME View or modify the system time.
TITLE Change the title of their MS-DOS window.
TRACERT Visually view a network packets route across a network.
TREE View a visual tree of the hard disk drive.
TYPE Display the contents of a file.
UNDELETE Undelete a file that has been deleted.
UNFORMAT Unformat a hard disk drive.
UNLOCK Unlock a disk drive.
VER Display the version information.
VERIFY Enables or disables the feature to determine if files have been written properly.
VOL Displays the volume information about the designated drive.
XCOPY Copy multiple files, directories, and/or drives from one location to another.
TRUENAME When placed before a file, will display the whole directory in which it exists
TASKKILL It allows you to kill those unneeded or locked up applications

Run Commands To Access The Control Panel

Add/Remove Programs control appwiz.cpl
Date/Time Properties control timedate.cpl
Display Properties control desk.cpl
FindFast control findfast.cpl
Fonts Folder control fonts
Internet Properties control inetcpl.cpl
Keyboard Properties control main.cpl keyboard
Mouse Properties control main.cpl
Multimedia Properties control mmsys.cpl
Network Properties control netcpl.cpl
Password Properties control password.cpl
Printers Folder control printers
Sound Properties control mmsys.cpl sounds
System Properties control sysdm.cp

Run Commands:

compmgmt.msc - Computer management
devmgmt.msc - Device manager
diskmgmt.msc - Disk management
dfrg.msc - Disk defrag
eventvwr.msc - Event viewer
fsmgmt.msc - Shared folders
gpedit.msc - Group policies
lusrmgr.msc - Local users and groups
perfmon.msc - Performance monitor
rsop.msc - Resultant set of policies
secpol.msc - Local security settings
services.msc - Various Services
msconfig - System Configuration Utility
regedit - Registry Editor
msinfo32 _ System Information
sysedit _ System Edit
win.ini _ windows loading information(also system.ini)
winver _ Shows current version of windows
mailto: _ Opens default email client
command _ Opens command prompt

Windows XP Shortcuts:

ALT+- (ALT+hyphen) Displays the Multiple Document Interface (MDI) child window's System menu
ALT+ENTER View properties for the selected item
ALT+ESC Cycle through items in the order they were opened
ALT+F4 Close the active item, or quit the active program
ALT+SPACEBAR Display the System menu for the active window
ALT+TAB Switch between open items
ALT+Underlined letter Display the corresponding menu
BACKSPACE View the folder one level up in My Computer or Windows Explorer
CTRL+A Select all
CTRL+B Bold
CTRL+C Copy
CTRL+I Italics
CTRL+O Open an item
CTRL+U Underline
CTRL+V Paste
CTRL+X Cut
CTRL+Z Undo
CTRL+F4 Close the active document
CTRL while dragging Copy selected item
CTRL+SHIFT while dragging Create shortcut to selected iteM
CTRL+RIGHT ARROW Move the insertion point to the beginning of the next word
CTRL+LEFT ARROW Move the insertion point to the beginning of the previous word
CTRL+DOWN ARROW Move the insertion point to the beginning of the next paragraph
CTRL+UP ARROW Move the insertion point to the beginning of the previous paragraph
SHIFT+DELETE Delete selected item permanently without placing the item in the Recycle Bin
ESC Cancel the current task
F1 Displays Help
F2 Rename selected item
F3 Search for a file or folder
F4 Display the Address bar list in My Computer or Windows Explorer
F5 Refresh the active window
F6 Cycle through screen elements in a window or on the desktop
F10 Activate the menu bar in the active program
SHIFT+F10 Display the shortcut menu for the selected item
CTRL+ESC Display the Start menu
SHIFT+CTRL+ESC Launches Task Manager
SHIFT when you insert a CD Prevent the CD from automatically playing
WIN Display or hide the Start menu
WIN+BREAK Display the System Properties dialog box
WIN+D Minimizes all Windows and shows the Desktop
WIN+E Open Windows Explorer
WIN+F Search for a file or folder
WIN+F+CTRL Search for computers
WIN+L Locks the desktop
WIN+M Minimize or restore all windows
WIN+R Open the Run dialog box
WIN+TAB Switch between open items