Chat with friends using Command Prompt ( CMD )

 Tools Required :-
1) IP Address of Friend with whom you want to chat
2) MS Dos Command Promp ( just go to Start >> Run >> Type "cmd" . .

Steps :-

1) Open the notepad and copy paste the below code into it ..

@echo off
:A 
Cls
echo MESSENGER 
set /p n=User: 
set /p m=Message: 
net send %n% %m% 
Pause
Goto A 


2) Save this as "Messenger.bat"
3) Now open the MS Dos Command Promp ( just go to Start >> Run >> Type "cmd" )
4) Drag this file ( Messenger.bat ) Command Prompt and then press Enter
5) Now type the IP Address of the Friend and press Enter
6) Now all you need it to type message and then press Enter to send Message

Note :- To chat with friend u have to enable Messanger
Click on Start >> Control Panel >> Administrator Tools >> Services >> Find for " Messanger "  . Open it
Startup Type : Automatic . . Then Click Start . .

Apply and then lastly OK !! 


Another Procedure for chatt from Command Prompt :

First of all you have to check if this service is enabled or not. To do that:
Step1 : start --> run --> (type) services.msc --> (press) ok
Step2 : find for 'messenger' services
Step3 : double click it ! change status form disabled to automatic if it is 'disabled'.
Step4 : and then press Start button & click finish.
Now, you need to open a Command Prompt Window (DOS), and use the NET command with Send parameter and to do that:
Step5: Click start --> run --> (type) cmd 
Step6: To send a message please type: net send name_of_user or computer_name or IP Address and the_text_message

 
In the above pic, uptest is a computer name

How to Find Out BIOS, Motherboard and CPU info from Command Line

To find the serial number, open command prompt (cmd) and type the following command.
c:\>wmic bios get serial number

image

First, fire up command prompt (cmd) from start menu.
command_line_get_biso_info

If you want to get info about your system’s BIOS, then type this command

wmic bios get name,serialnumber,version

This will tells you the name if your BIOS, current version and it’s serial number if there is any.

wmic csproduct get name,identifyingnumber,uuid


This command will tell you the system motherboard (that happen to be the name) and it’s UUID

wmic cpu get name,CurrentClockSpeed,MaxClockSpeed


If you want to quickly find out what’s the CPU clock speed, you can do the following, also if you have turbo boost CPUs you can find out what’s the Max Clock Speed your system is capable of for the current configuration. Of course you can always overclock your CPU and that will too reflect the change.

wmic cpu get name,CurrentClockSpeed,MaxClockSpeed /every:1


If you do have dynamic clock speed running, then add this line, will refresh and monitor the Clock speed every 1 second. Or you can set to however you would like.


Example :
C:\Documents and Settings\Administrator>wmic csproduct get name, identifyingnum
er
IdentifyingNumber  Name
DVQVB1S            OptiPlex 170L


C:\Documents and Settings\Administrator>wmic bios get serialnumber
SerialNumber
DVQVB1S
C:\Documents and Settings\Administrator>wmic csproduct get name
Name
OptiPlex 170L





How To Hide Drive In Windows Using Cmd Prompt:

You can hide a system hard disk using command prompt. This trick works on following platform:
1. Windows xp,
2. Windows vista,
3. Windows seven.

Steps:
1. Open your command prompt,
2. Just type "Diskpart" and press enter,
3. Now another cmd prompt box will get open,
4. There just type "List Volume" and press enter,
5. It will show the list of disk. Like below.

 6. If you want to hide the drive D then type "Select Volume 3",
     (Then you'll get the message "Volume 3 is the selected volume")
7. Now type "remove letter D",
     (Then you'll get the message "Diskpart removed the drive letter")
     *Then Just open your my computer and see, You'll not find the drive D there.
8. If not just restart your computer. Then check it out.
9. If you want to access the drive again just repeat the steps 1 to 6 and in 7th step instead of remove type "assign letter D". And restart your pc and check your my computer there you can find the drive D now.

Example :

C:\Documents and Settings\support>diskpart
Microsoft DiskPart version 5.1.3565 
Copyright (C) 1999-2003 Microsoft Corporation.
On computer: X-33927C34CD3F4 
DISKPART> list volume
Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  ----
  Volume 0     C                NTFS   Partition     16 GB  Healthy    Syst
  Volume 1     D                NTFS   Partition      9 GB  Healthy 
DISKPART> select volume 1 
Volume 1 is the selected volume. 
DISKPART> remove letter  D 
DiskPart successfully removed the drive letter or mount point. 
DISKPART> assign letter D 
DiskPart successfully assigned the drive letter or mount point.

Managing Disk Usage with Quotas.

Disk Quotas: This feature of Linux allows the system administrator to allocate a maximum amount of disk space a user or group may use.You may eventually need to restrict the amount of disk space used on each partition by each user or group of users as your disk drives become filled with data. The disk quota feature of RedHat/Fedora Linux enables you to do this

Edit your /etc/fstab file - You'll need to add the quota option to the /etc/fstab file to let it know that you are enabling user quotas in your file system.
[root@localhost usertest]# mkdir /usertest 
[root@localhost usertest]# vim /etc/fstab

/dev/hda8               /usertest               ext3    defaults,quota  0 0

Remount your file system - Once you finish editing your /etc/fstab file, you have to remount your filesystem as follows :
[root@localhost usertest]# mount -o remount,quota /usertest

Use mount command for show currently mounted disk and directory :
[root@localhost usertest]# mount
/dev/hda6 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/dev/hda8 on /usertest type ext3 (rw,quota,quota)

For using quota check command we open the the database,quotacheck - scan a filesystem for disk usage, create, check and repair quota files   
[root@localhost usertest]# quotacheck -cM /usertest

Quotaon announces to the system that disk quotas should be enabled on one or more filesystems.
[root@localhost usertest]# quotaon /usertest

The edquota command creates and edits quotas. It creates a temporary file that contains each user's and group's current disk quotas.
[root@localhost usertest]# edquota probal

Disk quotas for user probal (uid 500):
  Filesystem                   blocks       soft       hard     inodes     soft     hard
  /dev/hda8                         7          70        110          7          0        0

The repquota command prints a summary of quotas and disk usage for a file system specified by the FileSystem parameter.
[root@localhost usertest]# repquota -v /usertest/
*** Report for user quotas on device /dev/hda8
Block grace time: 7days; Inode grace time: 7days
                        Block limits                File limits
User            used            soft     hard        grace    used   soft   hard  grace
----------------------------------------------------------------------
root      --   10544            0         0                         4        0      0
probal    --     7               70       110                      7         0      0
saiful    --       7                0         0                         7         0      0

Statistics:
Total blocks: 7
Data blocks: 1
Entries: 3
Used average: 3.000000

For check quota for specific user probal we now  login as  probal
[root@localhost usertest]# su - probal

[probal@localhost ~]$ dd if=/dev/zero of=file bs=1024 count=110
hda8: warning, user block quota exceeded.
hda8: write failed, user block limit reached.
dd: writing `file': Disk quota exceeded
103+0 records in
102+0 records out
73728 bytes (74 kB) copied, 0.0188671 seconds, 3.9 MB/s
[probal@localhost ~]$ dd if=/dev/zero of=file bs=1024 count=50
50+0 records in
50+0 records out
51200 bytes (51 kB) copied, 0.000514527 seconds, 99.5 MB/s

[probal@localhost ~]$ dd if=/dev/zero of=file bs=1024 count=60
60+0 records in
60+0 records out
61440 bytes (61 kB) copied, 0.000604518 seconds, 102 MB/s

[probal@localhost ~]$ dd if=/dev/zero of=file bs=1024 count=65
hda8: warning, user block quota exceeded.
65+0 records in
65+0 records out
66560 bytes (67 kB) copied, 0.000754492 seconds, 88.2 MB/s

[root@localhost ~]# edquota saiful

Disk quotas for user saiful (uid 501):
  Filesystem                   blocks       soft       hard     inodes     soft     hard
  /dev/hda8                         7         50          80          7           0        0
~
[root@localhost ~]# repquota -v /usertest/
*** Report for user quotas on device /dev/hda8
Block grace time: 7days; Inode grace time: 7days
                        Block limits                File limits
User                        used        soft    hard     grace      used  soft  hard  grace
----------------------------------------------------------------------
root      --              10544        0         0                       4     0     0
probal    +-              73          70       110    6days        8     0     0
saiful    --                 7            50        80                      7     0     0
debashish --            7              0         0                       7     0      0

Statistics:
Total blocks: 7
Data blocks: 1
Entries: 4
Used average: 4.000000

[saiful@localhost ~]$ dd if=/dev/zero of=file bs=1024 count=40
40+0 records in
40+0 records out
40960 bytes (41 kB) copied, 0.000418989 seconds, 97.8 MB/s

[saiful@localhost ~]$ dd if=/dev/zero of=file bs=1024 count=60
hda8: warning, user block quota exceeded.
60+0 records in
60+0 records out
61440 bytes (61 kB) copied, 0.00072801 seconds, 84.4 MB/s

[saiful@localhost ~]$ dd if=/dev/zero of=file bs=1024 count=80
hda8: warning, user block quota exceeded.
hda8: write failed, user block limit reached.
dd: writing `file': Disk quota exceeded
73+0 records in
72+0 records out
73728 bytes (74 kB) copied, 0.0014104 seconds, 52.3 MB/s


Linux Change Default User Home Directory While Adding A New User

[root@localhost ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda6              15G  2.5G   11G  19% /
tmpfs                 124M     0  124M   0% /dev/shm
[root@localhost ~]# fdisk /dev/hda

The number of cylinders for this disk is set to 9733.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (8591-9733, default 8591):
Using default value 8591
Last cylinder or +size or +sizeM or +sizeK (8591-9733, default 9733): +500M
Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[root@localhost ~]# partprobe /dev/hda
[root@localhost ~]# partprobe /dev/hda
[root@localhost ~]# partprobe /dev/hda
[root@localhost ~]# fdisk -l

Disk /dev/hda: 80.0 GB, 80060424192 bytes
255 heads, 63 sectors/track, 9733 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1        2764    22201798+   7  HPFS/NTFS
/dev/hda2            2765        9733    55978492+   5  Extended
/dev/hda5            2765        6602    30828703+   7  HPFS/NTFS
/dev/hda6            6603        8514    15358108+  83  Linux
/dev/hda7            8515        8590      610438+  82  Linux swap / Solaris
/dev/hda8            8591        8652      497983+  83  Linux

[root@localhost ~]# mkfs.ext3 /dev/hda8
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
124928 inodes, 497980 blocks
24899 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67633152
61 block groups
8192 blocks per group, 8192 fragments per group
2048 inodes per group
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409

Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 21 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

[root@localhost ~]# mkdir /usertest
[root@localhost ~]# mount /dev/hda8 /usertest/
mount: you must specify the filesystem type

[root@localhost ~]# mount /dev/hda8 /usertest/
[root@localhost usertest]# vim /etc/fstab

/dev/hda8               /usertest               ext3    defaults        0 0

[root@localhost ~]# vim /etc/default/useradd
======================================================
GROUP=100
HOME=/usertest (Here we replace /home by /usertest)
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel
CREATE_MAIL_SPOOL=yes
=======================================================
[root@localhost ~]# useradd probal
[root@localhost ~]# passwd probal
Changing password for user probal.
New UNIX password:
BAD PASSWORD: it is too simplistic/systematic
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@localhost ~]# finger probal
Login: probal                           Name: (null)
Directory: /usertest/probal             Shell: /bin/bash
Never logged in.
No mail.
No Plan.
[root@localhost ~]# cd /usertest/
[root@localhost usertest]# ls
lost+found  probal

How to Internet Connection Sharing on a Windows Computer :

For Windows XP :

  1. Click Start.
  2. Click Control Panel.
  3. Double-click Network Connections (the icon circled in red in the following graphic).If your Control Panel window does not look similar to the following graphic, in the left-hand column of the window, click Switch to Classic View.
    controlpanel
  1. The following change only needs to be made if there is more than one network connection listed.
Resigzed Image
 
  1. For each network connection, right-click the connection and click Properties.
  2. Click the Advanced tab and verify that the checkbox in front of Allow other network users to connect through this computer's Internet connection is checked, as shown in the following graphic:
Network Connections

  1. Click OK to save the setting.

  2. You will see there is a hand supporting shared network connection,Close the Control Panel window.

    LAN Adapter configuration:

    When Internet Connection Sharing is enabled, your LAN adapter will be set to use IP
    address 192.168.0.1 subnet mask of 255.255.255.0
MADDE Lan settings.JPG

Other Computers on the LAN side:
The connection to the Internet is shared to other computers on the local area network (LAN). The network adapter that is connected to the LAN is configured with a static IP address range of( 192.168.0.2 to 192.168.0.254)and a subnet mask of 255.255.255.0 Default Gateway is 1952.168.0.1 & DNS address will be ISP proprietary DNS

For Windows Vista :

  1. Click Start.
  2. Click Control Panel. If your Control Panel window does not look similar to the following graphic, in the left-hand column of the window, click Classic View.
Control Panel Vista
  1. Double-click Network and Sharing Center.
  2. In the left-hand column of the Network and Sharing Center window, select Manage network connections.
Network Sharing Center Window
  1. The following change only needs to be made if there is more than one network connection listed. For each network connection listed, right-click the connection and click Properties.
Network Connection Window
  1. If you see the User Account Control dialog box at any point during the configuration process, click Continue.
User Account Control dialog box
  1. Click the Sharing tab.
  2. Under the Internet Connection Sharing section, make sure that the checkbox in front of Allow other network users to connect through this computer's Internet connection is checked, as shown in the following graphic:
Network Properties Window
  1. Click OK to save the setting.
  2. Close the Control Panel window.
 

For Windows 7 :

1.  Click Start    >    Click Control Panel.
Control Panel Vista
2.  Double-click Network and Internet
3.   Click Network and Sharing Center 
4.  In the left-hand column of the Network and Sharing window, select Change adapter settings
5.  The following change only needs to be made if there is more than one network connection listed. For each network connection listed, right-click the connection and click Properties
.
6.  If you see the User Account Control dialog box at any point during the configuration process, click Continue.
7.  Click the Sharing tab.   Under the Internet Connection Sharing, make sure that the checkbox in front of Allow other network users to connect through this computer's Internet connection is  checked, as shown in the following graphic:
8.  Click OK to save the setting

How to Change The MAC Address of system :

Steps:1
In Start menu or run, type regedit,  the system will automatically detect the option & display it.
image

Step 2 :
Press Regedit option, system registry editor screen will appear, locate the path
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318]


image

Step 3 :
On Key expand; you will see numbers 0000, 0001. Clicking on each number will show the device description matches with your network NIC, in any one of following tree numbers you will find network address option. In my case, it is 0009; click Network Address will open an Edit String screen. You can now insert new value for MAC address (12 digit number; with no space & ‘-‘)
image
Note: If no key is found, right-click & select “New” – “String Value”. Enter the name as “Network Address”and the desired value then press OK button.

Steps 4:

Now find the registry key "NetworkAddress" (without quotes). If not found create the new one and choose type String key as shown below:


create new registry key to change mac address
Registry View for creating new key



6. Double click the entry "NetworkAddress" and enter the new network address. Note that the new network address should have exactly twelve digits as shown below:


Enter new mac address in network key
Entering value of Network address key.



Note :Right click the network connection you have just modified, and then click disable. After the device has been disabled, right-click the connection again and click Enable.

Change in MAC Address from Network Connections Properties :

Step 1
From Start -> Control Panel-> Network & Sharing ->Change Adaptor Settings.  Right click any of the listed connections & select Properties option

image
Step 2
Connection properties screen will appear then Press Configure button. In Advanced tab, select MAC address option, enter desired address in the value field and press Ok button.

image

Disable USB Storage Using Regedit :

There is a simple registry change that will keep the USB storage drivers from starting when the system boots. Keeps people from walking up to a PC and copying data off with a USB storage or pendrive, but allows you to keep your scanner, keyboard, and mouse in working state.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor



Notice the value ‘Start
  • Switch this value to 4, and USB storage devices are disabled.
  • Switch this value to 3, and USB storage devices are enabled

Another procedure is :copy these text in to the notepad then save it as a .bat extension(Like: example.bat)

@ECHO off
cls
:start
ECHO Press: 1 - to Enable USB storage device.
ECHO Press: 0 - to Disable USB storage device.
ECHO.
set choice=
set /p choice=What is your choice [1,0]?
if not '%choice%'=='' set choice=%choice:~0,1%
if [%choice%]==[1] goto enable
if [%choice%]==[0] goto disable
ECHO "%choice%" is not a valid option. Please try again...
ECHO.
goto start
:enable
:: Create a temporary .REG file - ENABLE USB
> "%Temp%.\EnableUSBStor.reg" ECHO REGEDIT4
>>"%Temp%.\EnableUSBStor.reg" ECHO.
>>"%Temp%.\EnableUSBStor.reg" ECHO [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR]
>>"%Temp%.\EnableUSBStor.reg" ECHO "Start"=dword:00000003
:: Rename the following two files to ENABLE USB storage device on the computer
rename %SystemRoot%\Inf\Usbstor.pnf.fisha Usbstor.pnf
rename %SystemRoot%\Inf\Usbstor.inf.fisha Usbstor.inf
START /wait regedit /s "%Temp%.\EnableUSBStor.reg"
DEL "%Temp%.\EnableUSBStor.reg"
ECHO.
ECHO Successfully ENABLE USB storage device on this computer.
PAUSE
GOTO end
:disable
:: Create a temporary .REG file - DISABLE USB
> "%Temp%.\DisableUSBStor.reg" ECHO REGEDIT4
>>"%Temp%.\DisableUSBStor.reg" ECHO.
>>"%Temp%.\DisableUSBStor.reg" ECHO [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR]
>>"%Temp%.\DisableUSBStor.reg" ECHO "Start"=dword:00000004
:: Rename the following two files to DISABLE USB storage device on the computer
rename %SystemRoot%\Inf\Usbstor.pnf Usbstor.pnf.fisha
rename %SystemRoot%\Inf\Usbstor.inf Usbstor.inf.fisha
START /wait regedit /s "%Temp%.\DisableUSBStor.reg"
DEL "%Temp%.\DisableUSBStor.reg"
ECHO.
ECHO Successfully DISABLE USB storage device on this computer.
PAUSE
GOTO end
:end

Unhide Files in Virus Infected Pendrive Using Command Prompt & How to use task manager from cmd:

Unhide Files in Virus Infected Pendrive Using Command Prompt :

One sure way to retrieve your file or folder attributes back to unhidden is to use command prompt in windows. All you have to do is described below in steps.

STEP 1:
Plug your pendrive to USB port of your computer. Make sure it is detected.

STEP 2:

Start command prompt by Click Start>>Run and type cmd then hit enter.

STEP3
Find the drive letter for the conected USB drive. For example, G:
In command prompt, type G:
Then type
attrib -s -h /s /d *.*

Make sure that you put space between each elements in the code.
hit enter, wait a moment and this should unhide all your files on your pendrive. Checkout the screenshot for more to clarify.

How to view hidden folders:

  • Click on Start –> Control Panel –> Folder Options.
  • Click on the View Tab and check the radio button “show hidden files and folders” and press OK.
  • This will enable you to see the hidden file.

By using DOS Command – attrib:You can do the same with DOS command also at Command Prompt. Here, We will use the DOS Command “attrib” to accomplish the same task.

  • Click on Start –> Run –> cmd
  • For example, I have a directory called “Perl” in root directory and I want to hide that directory with the help of attribute command.
  • Change the directory one level back to the directory you want to hide.
  • Type attrib +h Perl and hit Enter. That’s all, Perl folder is hidden now. You can type dir on the command prompt and you will not see Perl there in root directory.
  • Type attrib –h Perl to unhide the folder.


Little more about attrib: attrib is a DOS command to change the attribute of folder and files at command prompt. + and – are used to set and clear the attrib respectively.
Avaialable attributes are:

  • R – Set the file Read-Only
  • A – Set Archive attribute to files.
  • S – System file attributes
  • H – Hidden file attributes.

 

 

How to change Administartor password:

How to Change User Password from Command Prompt:

To change a user's password at the command prompt, log on as an administrator and type:

 net user user_name  new_password 

Example:C:\>net user administrator private
                   The command completed successfully.

IP Security policy

  Allow or Deny Websites by using IP Securiry Policy


1)Click Start, and then click Run.



2) Right-click IP Security Policies in the left pane of the Security Settings console. Select Creat IP Security Policy



3) In the IP Security Policy Name window type a descriptive name (such as X-Net Security Policy) and click Next


4) In the IP Security Policy  window wizard  click Next



5) In the IP Security Policy  window wizard  click Next



6) In the Warning  window click Yes:




7) Click Finish:




8)In the X-Net Security policy actions click Add.



9) Click Next



10) Click Next



11) Click Next



12) Click Next



13) Click Yes




14) Click Add from IP Filter List Window


For Deny all websites :

15) Add a description like Allow or  Deny(Websites),Here i block all websites and IP address 



16) Click Add for specify source and destination IP, then click Next




17)Select Source IP address is My IP address




18) Select Destination IP address is Any IP address for block all websites



19) Click Next




20) Click Finish



21)Select block websites then Next



22)Click Require Security then Next



23)Click Finish



24)Right-click to the X-Net Security policy then select Assign



For Allow Specific Websites:

25)Right-click to the X-Net Security policy then click Add



26) Click Next



27) Click next



28)Click Next



29) Click Next



30) Click Yes




31) Add a description like Allow or  Deny(Websites),Here i Allow  Specific  website facebook. Complete the description then Click Add



32) Click Next



33) Select Source IP Address is My IP Address then press Next




34) Select Destination IP Address is Specific Website. Here i allow facebook so Destination web site is facebook.

Click Next



35) Click Yes



36) Click Next



37) Click Finish



38) Click OK



39)Select Allow Specific Websites then click Next




40)Select permit then click Next



41) Click Finish




42)Click Apply then OK


43)Right-Click to the X-Net Security policy then select Assign