IT tutorials
 
Windows
 

Using Windows Home Server’s Command-Line Tools : Working with the Command-Line Tools (part 3)

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
5/29/2013 7:35:59 PM

3. Working with System Management Tools

System Management is one of those catch-all terms that encompasses a range of tasks, from simple adjustments such as changing the system date and time to more complex tweaks such as modifying the Registry. Windows Home Server’s command-line system management tools also enable you to monitor system performance, shut down or restart the computer, and even modify the huge Windows Management Instrumentation (WMI) interface. Table 4 lists the system management command-line tools that apply to Windows Home Server.

Table 4. Windows Home Server’s Command-Line System Management Tools
ToolDescription
CHCPDisplays or changes the number of active console code pages.
DATEDisplays or sets the system date.
EVENTCREATECreates a custom event in an event log.
REGAdds, modifies, displays, and deletes Registry keys and settings.
REGSVR32Registers dynamic-link library (DLL) files as command components in the Registry.
SHUTDOWNShuts down or restarts Windows Home Server or a remote computer.
SYSTEMINFODisplays a wide range of detailed configuration information about the computer.
TIMEDisplays or sets the system time.
TYPEPERFMonitors a performance counter.
WHOAMIDisplays information about the current user, including the domain name (not applicable to Windows Home Server), computer name, username, security group membership, and security privileges.
WMICOperates the Windows Management Instrumentation command-line tool that provides command-line access to the WMI interface.

The next few sections take more detailed looks at five of these command-line tools: REG, SHUTDOWN, SYSTEMINFO, TYPEPERF, and WHOAMI.

REG: Working with Registry Keys and Settings

There may be some settings that you change quite often. In such cases, it can become burdensome to frequently launch the Registry Editor and change the settings. A better idea is to create a shortcut or batch file that uses the REG command-line tool to make your Registry changes for you.

REG actually consists of 11 subcommands, each of which enables you to perform different Registry tasks:

REG ADDAdds new keys or settings to the Registry. You can also use this command to modify existing settings.
REG QUERYDisplays the current values of one or more settings in one or more keys.
REG COMPARECompares the values of two Registry keys or settings.
REG COPYCopies Registry keys or settings to another part of the Registry.
REG DELETEDeletes a key or setting.
REG EXPORTExports a key to a .reg file.
REG IMPORTImports the contents of a .reg file.
REG SAVECopies Registry keys or settings to a hive (.hiv) file.
REG RESTOREWrites a hive file into an existing Registry key. The hive file must be created using REG SAVE.
REG LOADLoads a hive file into a new Registry key. The hive file must be created using REG SAVE.
REG UNLOADUnloads a hive file that was loaded using REG LOAD.

I won’t go through all these commands. Instead, I’ll focus on the three most common Registry tasks: viewing, adding, and modifying Registry data.

Viewing Registry Data

To view the current value of the Registry setting, you use the REG QUERY command:

REG QUERY KeyName [/V SettingName | /VE] [/C] [/D] [/E] [/F data] [/K | [/S] [/SE separator] [/T type] [/Z]

					  

KeyNameThe Registry key that contains the setting or settings that you want to view. The KeyName must include a root key value: HKCR, HKCU, HKLM, HKU, or HKCC. Place quotation marks around key names that include spaces.
/V ValueNameThe Registry setting in KeyName that you want to view.
/VETells REG to look for empty settings (that is, settings with a null value).
/F dataSpecifies the data that REG should match in the KeyName settings.
/CRuns a case-sensitive query.
/EReturns only exact matches.
/KQueries only key names, not settings.
/STells REG to query the subkeys of KeyName.
/SE separatorDefines the separator to search for in REG_MULTI_SZ settings.
/T typeSpecifies the setting type or types to search: REG_SZ, REG_MULTI_SZ, REG_EXPAND_SZ, REG_DWORD, REG_BINARY, or REG_NONE.
/ZTells REG to include the numeric equivalent of the setting type in the query results.

For example, if you want to know the current value of the RegisteredOwner setting in HKLM\Software\Microsoft\Windows NT\CurrentVersion, you’d run the following command:

reg query "hklm\software\microsoft\windows nt\currentversion" /v registeredowner

					  

The Registry Editor has a Find command that enables you to look for text within the Registry. However, it would occasionally be useful to see a list of the Registry keys and settings that contains a particular bit of text. You can do this using the /F switch. For example, suppose you want to see a list of all the HKLM keys and settings that contain the text Home Server. Here’s a command that will do this:

reg query hklm /f "Home Server " /s

Adding Registry Data

To add a key or setting to the Registry, use the REG ADD command:

REG ADD KeyName [/V SettingName | /VE] [/D data] [/F | [/S separator] [/T type]

					  

KeyNameThe Registry key that you want to add or to which you want to add a setting. The KeyName must include a root key value: HKCR, HKCU, HKLM, HKU, or HKCC. Place quotation marks around key names that include spaces.
/V ValueNameThe setting that you want to add to KeyName.
/VETells REG to add an empty setting.
/D dataSpecifies the data that REG should use as the value for the new setting.
/FModifies an existing key or setting without prompting to confirm the change.
/S separatorDefines the separator to use between multiple instances of data in a new REG_MULTI_SZ setting.
/T typeSpecifies the setting type: REG_SZ, REG_MULTI_SZ, REG_EXPAND_SZ, REG_DWORD, REG_BINARY, or REG_NONE.

For example, the following command adds a key named MySettings to the HKCU root key:

reg add hkcu\MySettings

Here’s another example that adds a setting named CurrentProject to the new MySettings key and sets the value of the new settings to WHS Unleashed:

reg add hkcu\MySettings /v CurrentProject /d "WHS Unleashed"

Modifying Registry Data

If you want to make changes to an existing setting, run REG ADD on the setting. For example, to change the HKCU\MySettings\CurrentProject setting to Windows Home Server Unleashed, you run the following command:

reg add hkcu\MySettings /v CurrentProject /d "Windows Home Server Unleashed"

					  

Windows Home Server responds with the following prompt:

Value CurrentProject exists, overwrite (Yes/No)?

To change the existing value, press Y and press Enter.

Tip

To avoid being prompted when changing existing settings, add the /F switch to the REG ADD command.

 
Others
 
- Using Windows Home Server’s Command-Line Tools : Working with the Command-Line Tools (part 2) - Working with File and Folder Management Tools
- Using Windows Home Server’s Command-Line Tools : Working with the Command-Line Tools (part 1) - Working with Disk Management Tools
- Windows 8 : Security - Action Center
- Windows 8 : Security - Windows Defender
- Windows Vista : Exploring Expert File and Folder Techniques - Customizing Windows Explorer
- Windows Vista : Exploring Expert File and Folder Techniques - Shadow Copies and Transactional NTFS
- Windows Vista : Exploring Expert File and Folder Techniques - Grouping, Stacking, and Filtering with Metadata
- Windows 7 : Troubleshooting Your Internet Connection (part 5)
- Windows 7 : Troubleshooting Your Internet Connection (part 4) - Identifying Network Hardware Problems
- Windows 7 : Troubleshooting Your Internet Connection (part 3) - Identifying Software Configuration Problems
 
 
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