IT tutorials
 
Windows
 

Using Windows Home Server’s Command-Line Tools : Getting to the Command Line

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
4/30/2013 3:35:28 AM

To take advantage of the command line and all its many useful commands, you need to start a command-line session. Windows Home Server offers a number of ways to get to the command prompt:

  • Select Start, Command Prompt.

  • Press Windows Logo+R (or select Start, Run), type cmd in the Run dialog box, and click OK. (You can also click Start, type cmd, and then press Enter.)

  • Create a shortcut for %SystemRoot%\system32\cmd.exe on your desktop (or some other convenient location, such as the taskbar), and then launch the shortcut.

  • Reboot your computer, press F8 to display Windows Home Server’s Advanced Boot Options menu, and select the Safe Mode with Command Prompt item.

Note

It’s also possible to configure Windows Home Server’s Folder file type to open the command prompt in Windows Explorer’s current folder.


Running CMD

For the methods that use the CMD executable, you can specify extra switches after the cmd.exe filename. Most of these switches aren’t particularly useful, so let’s start with the simplest syntax that you’ll use most often:

CMD [[/S] [/C | /K] command]

/SStrips out the first and last quotation marks from the command, provided that the first quotation mark is the first character in command.
/CExecutes the command and then terminates.
/KExecutes the command and remains running.
commandSpecifies the command to run.

For example, if your Internet service provider (ISP) provides you with a dynamic Internet Protocol (IP) address, you can often solve some connection problems by asking the IP for a fresh address. You do that by running the command ipconfig /renew at the command line. In this case, you don’t need the Command Prompt window to remain open, so you can specify the /C switch to shut down the command-line session automatically when the IPCONFIG utility finishes:

cmd /c ipconfig /renew

On the other hand, you often either want to see the results of the command, or want to leave the Command Prompt window open so that you can run other commands. In those cases, use the /K switch. For example, the following command runs the SET utility (which displays the current values of the Windows Home Server environment variables) and then leaves the command-line session running:

cmd /k set

Here’s the full syntax of cmd.exe:

CMD [/A | /U] [/Q] [/D] [/T:bf] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF] [[/S] [/C | /K] command]

					  

/QTurns off command echoing. If command is a batch file, you won’t see any of the batch file commands as they’re executed. This is the same as adding the statement @ECHO OFF at the beginning of a batch file.
/DDisables the execution of AutoRun commands from the Registry. These are commands that run automatically when you start any command-line session. You can find the settings here:
HKLM\Software\Microsoft\Command Processor\AutoRun
HKCU\Software\Microsoft\Command Processor\AutoRun


Note

If you do not see an AutoRun setting in one or both keys, select the key; select File, New, String Value; type AutoRun; and press Enter.


Tip

The AutoRun Registry settings are handy if you always run a particular command at the beginning of each command-line session. If you run multiple commands to launch a session, you can add those commands to either AutoRun setting. In that case, you must separate each command with the command separator string: &&. For example, to run the IPCONFIG and SET utilities at the start of each command-line session, change the value of an AutoRun setting to the following:

ipconfig&&set


/AConverts the output of internal commands to a pipe or file to the American National Standards Institute (ANSI) character set.
/UConverts the output of internal commands to a pipe or file to the Unicode character set.
/T:bfSets the foreground and background colors of the Command Prompt window, where f is the foreground color and b is the background color. Both f and b are hexadecimal digits that specify the color as follows:
 0Black8Gray
 1Blue9Light Blue
 2GreenALight Green
 3AquaBLight Aqua
 4RedCLight Red
 5PurpleDLight Purple
 6YellowELight Yellow
 7WhiteFBright White

Tip

You can also set the foreground and background colors during a command-line session by using the COLOR bf command, where b and f are hexadecimal digits specifying the colors you want. To revert to the default command prompt colors, run COLOR without the bf parameter.


/E:ONEnables command extensions, which are extra features added to the following commands. (At the command line, type the command name followed by a space and /? to see the extensions.)
 ASSOCIF
 CALLMD or MKDIR
 CD or CHDIRPOPD
 COLORPROMPT
 DEL or ERASEPUSHD
 ENDLOCALSET
 FORSETLOCAL
 FTYPESHIFT
 GOTOSTART
/E:OFFDisables command extensions.
/F:ONTurns on file and directory name completion, which enables you to press special key combinations to scroll through a list of files or subdirectories in the current directory that match the characters you’ve already typed. For example, suppose that the current directory contains files named budget2009.doc, budget2010.doc, and budget2011.doc. If you type start budget in a command-line session started with /F:ON, pressing Ctrl+F tells Windows Home Server to display the first file (or subfolder) in the current folder with a name that starts with budget. Pressing Ctrl+F again displays the next file with a name that starts with budget, and so on. You can do the same thing with just subfolder names by pressing Ctrl+D instead.

Tip

You don’t need to start the command prompt with the /F:ON switch to use file and directory name completion. The command prompt offers a similar feature called AutoComplete that’s turned on by default. At the prompt, type the first letter or two of a file or subfolder name, and then press the Tab key to see the first object that matches your text in the current folder. Keep pressing Tab to see other matching objects. If, for some reason, you prefer to turn off AutoComplete, pull down the Command Prompt window’s control menu (right-click the title bar), select Defaults, and then deactivate the AutoComplete check box in the Options tab.


/F:OFFTurns off file and directory name completion.
/V:ONEnables delayed environment variable expansion using ! as the delimiter: !var!, where var is an environment variable. This is useful for batch files in which you want to delay the expansion of an environment variable. Normally, Windows Home Server expands all environment variables to their current values when it reads the contents of a batch file. With delayed expansion enabled, Windows Home Server doesn’t expand a particular environment variable within a batch file until it executes the statement containing that variable.
/V:OFFDisables delayed environment expansion.
/SStrips out the first and last quotation marks from command, provided the first quotation mark is the first character in command.
/CExecutes the command and then terminates.
/KExecutes the command and remains running.
commandSpecifies the command to run.

Opening a Folder in a Command Prompt Session

When you’re working in Windows Explorer, you might find that you need to do some work at the command prompt. For example, the current folder might contain multiple files that need to be renamed—a task that’s most easily done within a command-line session. Selecting Start, Command Prompt starts the session in the %USERPROFILE% folder, so you have to use one or more CD commands to get to the folder you want to work in.

An easier way is to create a new action for the Folder file type that launches the command prompt and automatically displays the current Windows Explorer folder. To do this, follow these steps:

1.
Select Start, Run (or press Windows Logo+R), type regedit, and then click OK to open the Registry Editor.

2.
Navigate to the following key:

HKCR\Folder\shell

3.
Select Edit, New, Key. Type Open with Command Prompt, and press Enter.

4.
Make sure that the key you created in step 3 is selected, and then select Edit, New, Key. Type command, and press Enter.

5.
With the new command key selected, double-click the Default value to open the Edit String dialog box.

6.
Type the following:

cmd.exe /k cd "%L"

Note

In the command string, cd represents the command prompt’s internal CD (change directory) command, which changes the prompt to another folder. The %L placeholder represents the full pathname of the current folder.

7.
Click OK.

Figure 1 displays two windows. The top window is the Registry Editor showing the new Open with Command Prompt action added to the HKCR\Folder\shell key; in the bottom window, I right-clicked a folder. Notice how the new action appears in the shortcut menu.

Figure 1. After you add the new action to the HKCR\Folder\shell key, the action appears in the folder file type’s shortcut menu.
 
Others
 
- Windows Vista : Desktop Searching with the Windows Search Engine
- Windows Vista : Metadata and the Windows Explorer Property System
- Windows 7 : Email and Newsgroups with Windows Live Mail - Creating and Sending New Mail
- Windows 7 : Email and Newsgroups with Windows Live Mail - Windows Live Mail Quick Tour
- Monitoring Windows Small Business Server 2011 : Configuring the Backup Service (part 2) - Windows Server Backup Using Native Tools
- Monitoring Windows Small Business Server 2011 : Configuring the Backup Service (part 1) - Windows Server Backup Using SBS Wizards
- Windows 8 : Settings and Customization - Modifying Startup Programs and Services
- Windows 8 : Settings and Customization - Windows Features
- Microsoft Windows Home Server 2011 : Restoring Network Backups
- Microsoft Windows Home Server 2011 : Working with Backups
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us