Aerrow's blog

December 2009 - Posts

command IV……..CONFIG IP

 

netsh interface ip show config

With Netsh.exe, you can easily configure your computer's IP address and other TCP/IP related settings. For example:

The following command configures the interface named Local Area Connection with the static IP address 192.168.0.100, the subnet mask of 255.255.255.0, and a default gateway of 192.168.0.1:

netsh interface ip set address name="Local Area Connection" static 192.168.0.100 255.255.255.0 192.168.0.1 1

Netsh.exe can be also useful in certain scenarios such as when you have a portable computer that needs to be relocated between 2 or more office locations, while still maintaining a specific and static IP address configuration. With Netsh.exe, you can easily save and restore the appropriate network configuration.

First, connect your portable computer to location #1, and then manually configure the required settings (such as the IP address, Subnet Mask, Default Gateway, DNS and WINS addresses).

Now, you need to export your current IP settings to a text file. Use the following command:

netsh -c interface dump > c:'location1.txt

When you reach location #2, do the same thing, only keep the new settings to a different file:

netsh -c interface dump > c:'location2.txt

You can go on with any other location you may need, but we'll keep it simple and only use 2 examples.

Now, whenever you need to quickly import your IP settings and change them between location #1 and location #2, just enter the following command in a Command Prompt window (CMD.EXE):

netsh -f c:'location1.txt

or

netsh -f c:'location2.txt

and so on.

You can also use the global EXEC switch instead of -F:

netsh exec c:'location2.txt

Netsh.exe can also be used to configure your NIC to automatically obtain an IP address from a DHCP server:

netsh interface ip set address "Local Area Connection" dhcp

Would you like to configure DNS and WINS addresses from the Command Prompt? You can. See this example for DNS:

netsh interface ip set dns "Local Area Connection" static 192.168.0.200

and this one for WINS:

netsh interface ip set wins "Local Area Connection" static 192.168.0.200

Or, if you want, you can configure your NIC to dynamically obtain it's DNS settings:

netsh interface ip set dns "Local Area Connection" dhcp

BTW, if you want to set a primary and secondary DNS address, add index=1 and index=2 respectively to the lines of Netsh command.

As you now see, Netsh.exe has many features you might find useful, and that goes beyond saying even without looking into the other valuable options that exist in the command.

Enjoy playing with ur Command.

Posted: 12-28-2009 9:00 AM by The Aerrow | with no comments
Filed under:
command III……REGISTRY

Registry is the most powerful tool in windows operating system, any errors occurs in our machine we try to solve it through the regedit first….even now a days we try to fix the viruses through registry.we may not able to access our GUI mode of Registry when our machine get infected by virus so through this blog I am trying to share my knowledge of CUI mode edit and operation of Regedit.Hope you will enjoy this.

Here the command line goes….

REG Operation [Parameter List]

Operation [ QUERY | ADD | DELETE | COPY | SAVE | LOAD | UNLOAD | RESTORE | COMPARE | EXPORT | IMPORT ]

Return Code: (Except of REG COMPARE)

0 - Succussful
1 - Failed

REG QUERY

REG QUERY KeyName [/v ValueName | /ve] [/s]

KeyName
[\Machine\]FullKey

Machine
Name of remote machine, omitting defaults to the current machine
Only HKLM and HKU are available on remote machines

FullKey
in the form of ROOTKEY\SubKey name
ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ]
SubKey - The full name of a registry key under the selected ROOTKEY

/v
query for a specific registry key

ValueName
The name, under the selected Key, to query if omitted, all values under the Key are queried

/ve
query for the default value or empty value name <no name>

/s
queries all subkeys and values

REG ADD

REG ADD KeyName [/v ValueName | /ve] [/t Type] [/s Separator] [/d Data] [/f]

KeyName
[\\Machine\]FullKey

Machine
Name of remote machine - omitting defaults to the current
machine Only HKLM and HKU are available on remote machines

FullKey
ROOTKEY\SubKey
ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ]
SubKey The full name of a registry key under the selected ROOTKEY

/v
The value name, under the selected Key, to add

/ve
adds an empty value name <no name> for the key

/t RegKey
data types
[ REG_SZ | REG_MULTI_SZ | REG_DWORD_BIG_ENDIAN | REG_DWORD | REG_BINARY | REG_DWORD_LITTLE_ENDIAN | REG_NONE | REG_EXPAND_SZ ]
If omitted, REG_SZ is assumed

/s
Specify one charactor that you use as the separator in your data
string for REG_MULTI_SZ. If omitted, use "\0" as the separator

/d
The data to assign to the registry ValueName being added

/f
Force overwriting the existing registry entry without prompt

REG DELETE

REG DELETE KeyName [/v ValueName | /ve | /va] [/f]

KeyName
[\\Machine\]FullKey

Machine
Name of remote machine - omitting defaults to the current machine
Only HKLM and HKU are available on remote machines

FullKey
ROOTKEY\SubKey
ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ]
SubKey The full name of a registry key under the selected ROOTKEY

ValueName
The value name, under the selected Key, to delete
When omitted, all subkeys and values under the Key are deleted

/ve
delete the value of empty value name <no name>

/va
delete all values under this key

/f
Forces the deletion without prompt

REG COPY

REG COPY KeyName1 KeyName2 [/s] [/f]

KeyName
[\\Machine\]FullKey

Machine
Name of remote machine - omitting defaults to the current machine
Only HKLM and HKU are available on remote machines

FullKey
ROOTKEY\SubKey
ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ]
SubKey The full name of a registry key under the selected ROOTKEY

/s
Copies all subkeys and values

/f
Forces the copy without prompt

REG SAVE

REG SAVE KeyName FileName

KeyName
ROOTKEY\SubKey
ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ]
SubKey The full name of a registry key under the selected ROOTKEY

FileName
The name of the disk file to save. If no path is specified, the file is created in the current folder of the calling process

REG RESTORE

REG RESTORE KeyName FileName

KeyName
ROOTKEY\SubKey (local machine only)
ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ]
SubKey The full name of a registry key to restore the hive file into.
Overwriting the existing key's values and subkeys

FileName
The name of the hive file to restore
You must use REG SAVE to create this file

REG LOAD

REG LOAD KeyName FileName

KeyName
ROOTKEY\SubKey (local machine only)
ROOTKEY [ HKLM | HKU ]
SubKey The key name to load the hive file into. Creating a new key

FileName
The name of the hive file to load
You must use REG SAVE to create this file

REG UNLOAD

REG UNLOAD KeyName

KeyName
ROOTKEY\SubKey (local machine only)
ROOTKEY [ HKLM | HKU ]
SubKey The key name of the hive to unload

REG COMPARE

REG COMPARE KeyName1 KeyName2 [/v ValueName | /ve] [Output] [/s]

KeyName
[\\Machine\]FullKey
Machine Name of remote machine - omitting defaults to the current machine
Only HKLM and HKU are available on remote machines
FullKey ROOTKEY\SubKey
If FullKey2 is not specified, FullKey2 is the same as FullKey1
ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ]
SubKey The full name of a registry key under the selected ROOTKEY

ValueName
The value name, under the selected Key, to compare
When omitted, all values under the Key are compared

/ve
compare the value of empty value name <no name>

/s
Compare all subkeys and values

Output
[/oa | /od | /os | /on]
When omitted, output only differences

/oa Output all of differences and matches
/od Output only differences
/os Output only matches
/on No output

Return Code:

0 - Succussful, the result compared is identical
1 - Failed
2 - Successful, the result compared is different

REG EXPORT

REG EXPORT KeyName FileName

Keyname
ROOTKEY\SubKey (local machine only)
ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ]
SubKey The full name of a registry key under the selected ROOTKEY

FileName
The name of the disk file to export

REG IMPORT

REG IMPORT FileName

FileName
The name of the disk file to import (local machine only)

Examples

Each of the below examples are the examples Microsoft has listed in each of the command help menus available through the /? switch on this command.

Reg query examples:

REG QUERY HKLM\Software\Microsoft\ResKit /v Version

Displays the value of the registry value Version

REG QUERY HKLM\Software\Microsoft\ResKit\Nt\Setup /s

Displays all subkeys and values under the registry key Setup

Reg add Examples:

REG ADD file://abc/HKLM/Software/MyCo

Adds a key HKLM\Software\MyCo on remote machine ABC

REG ADD HKLM\Software\MyCo /v Data /t REG_BINARY /d fe340ead

Adds a value (name: Data, type: REG_BINARY, data: fe340ead)

REG ADD HKLM\Software\MyCo /v MRU /t REG_MULTI_SZ /d fax\0mail

Adds a value (name: MRU, type: REG_MUTLI_SZ, data: fax\0mail\0\0)

REG ADD HKLM\Software\MyCo /v Path /t REG_EXPAND_SZ /d %%systemroot%%

Adds a value (name: Path, type: REG_EXPAND_SZ, data: %systemroot%)
Notice: Use the double percentage ( %% ) inside the expand string

Reg delete examples:

REG DELETE HKLM\Software\MyCo\MyApp\Timeout

Deletes the registry key Timeout and its all subkeys and values

REG DELETE \\ZODIAC\HKLM\Software\MyCo /v MTU

Deletes the registry value MTU under MyCo on ZODIAC

Reg copy examples:

REG COPY HKLM\Software\MyCo\MyApp HKLM\Software\MyCo\SaveMyApp /s

Copies all subkeys and values under the key MyApp to the key SaveMyApp

REG COPY \\ZODIAC\HKLM\Software\MyCo HKLM\Software\MyCo1

Copies all values under the key MyCo on ZODIAC to the key MyCo1
on the current machine

Reg save examples:

REG SAVE HKLM\Software\MyCo\MyApp AppBkUp.hiv

Saves the hive MyApp to the file AppBkUp.hiv in the current folder

Reg restore examples:

REG RESTORE HKLM\Software\Microsoft\ResKit NTRKBkUp.hiv

Restores the file NTRKBkUp.hiv overwriting the key ResKit

Reg load examples:

REG LOAD HKLM\TempHive TempHive.hiv

Loads the file TempHive.hiv to the Key HKLM\TempHive

Reg unload examples:

REG UNLOAD HKLM\TempHive

Unloads the hive TempHive in HKLM

Reg compare examples:

REG COMPARE HKLM\Software\MyCo\MyApp HKLM\Software\MyCo\SaveMyApp

Compares all values under the key MyApp with SaveMyApp

REG COMPARE HKLM\Software\MyCo HKLM\Software\MyCo1 /v Version

Compares the value Version under the key MyCo and MyCo1

REG COMPARE \\ZODIAC\HKLM\Software\MyCo \\. /s

Compares all subkeys and values under HKLM\Software\MyCo on ZODIAC
with the same key on the current machine

Reg export examples:

REG EXPORT HKLM\Software\MyCo\MyApp AppBkUp.reg

Exports all subkeys and values of the key MyApp to the file AppBkUp.reg

Reg import examples:

REG IMPORT AppBkUp.reg

Imports registry entrys from the file AppBkUp.reg

 

Enjoy testing…..

Check your Reliability Monitor in Windows 7

The Reliability Monitor was introduced in Windows Vista as 'The Reliability and Performance Monitor." In Windows 7 it has been separated from Performance Monitor and moved to a new location under the Action Center. You open the Action Center in Control Panel and then look under the Maintenance options for the "View reliability history" link. You can also just type in Reliability Monitor from the Instant Search

reliability monitor

Check your Reliability Monitor…….Check your system.

Make your Own LIVEBOOT CD of Windows XP…

This Topic seems to be a bit crazy….but you can do it now….I have been searching a new technique to boot operation system in my machine….on which i don’t have to install operating system…it directly run from the CD/DVD. Why do i need such kind of things?

  • If your operating system fails for some reason, you will still be able to access your hard drives and salvage the data.
  • If your operating system gets hit by a nasty infection, you will be able to remove it easily.
  • If you suspect a hidden rootkit, there's no better method to inspect your drives.
  • If you want to browse the Internet safely, this is one good way of doing it.

    I think these answer make you satisfy why you need the liveboot CD or DVD…..Here I am introducing you guys a new application PE Builder with help of which you can make your own liveboot CD/DVD.

    Here we start…

    First, download and install the PE Builder.
    I want to bring your attention to a subfolder that is automatically created when you install the PE Builder:

    \..\pebuilder folder\plugin

    Replace \..\pebuilder folder\ with your installation path. Remember the plugin folder. Now, let's move on.
    Now, start the program. The interface looks like this:

    01.bmp

    You should specify the source of Windows installation files (most likely your Windows CD), custom folders and files that you might like to include, the location of the created output, and the location and the name of the .iso image. So far so good.
    But we are also very much interested in Plugins.
    Clicking Plugins will open a new sub-menu:

    02.bmp

    Click ‘add’ and browse to the location where you stored the Windows XPE plug-in to add it. Since we are using the XPE plug-in you can safely disable the Nu2shell, PENETCFG and A43 plugins since these offer functionality that is already included with the XPE plug-in.as shown in picture you can disable Nu2shell but you have to enable Nu2menu.

    Click ‘close’. You can now directly burn a disc or save an ISO file for testing which you can burn later. Click ‘build’ and PE builder will get to work.

    03.bmp 04.bmp06.bmp 07.bmp

    If the build process completes without any errors, you have made yourself a Live CD.

    Mine completed in just under 2 minutes without any errors and amounted to 270 MB with Windows XPE plug-in and 154 MB without it. Here are the screen shots from my LiveCD which I tested in my Virtual machine.

    09.bmp

    First I made my machine boot from CD….then the black screen came as it comes while installing Windows XP…but later on the system started to load….and these are the screenshots..

    10.bmp 11.bmp

     

    For Full Screenshot you can view this album too..

    I have just succeeded this windows XP and now soon will be blogging about how to make live cd of windows Vista and Windows 7…..I think it will be more interesting for us to make it in Windows 7,and more complicated.