Wednesday, January 25, 2012

How to block a website using window HOSTS file

What is a Hosts file:

The Hosts file contains the mappings of IP addresses to host names. This file is loaded into memory (cache) at startup, then Windows checks the Hosts file before it queries any DNS servers, which enables it to override addresses in the DNS.  It basically tells your computer where to look for a certain website. When you type an address in the address bar of your web browser, it checks for instructions on the HOSTS file. If no record about a website is found, it opens a website for you. Otherwise, it opens a website from an IP address defined on the HOSTS file.


You can use a HOSTS file to block ads, banners, 3rd party Cookies, 3rd party page counters, web bugs, and even most hijackers. This is accomplished by blocking the connection(s) that supplies these little gems. 

How to block a website using window hosts file:

The host file is located under this path on your System:

C:\Windows\System32\drivers\etc



For Windows 7 users, type “Notepad” in Start Menu search bar, and then right click on the “Notepad” item, choose “Run as administrator”. Now you can open HOSTS file with “File -> Open” menu in notepad


The HOSTS file contains IP address and hostnames. You can add the mapping relationship of each websites.
 
 
The entry must have an IP address and the address of the website which you want to block. Choose 127.0.0.1 as an IP address, leave a space or press tab and then type the address of the website. See the example below:


Do not use # before the blocked website entry. To allow access to a website, simply remove the entry or you can add # before the line.


Hope this will work for you...

Thanks and Regards

PRdeep Kumawat
Network Engineer


Saturday, January 21, 2012

How to hide files and folders using attrib command

Folder hiding is a simple way of keeping prying eyes away from your private documents. We all want to make our private folders hide. Just checking mark on ‘Hide’ button from folder’s properties is not a proper way to hide our folder. Everyone can view these hidden folders by putting check mark on ‘Show hidden files’ from folder options of the window explorer.

So today we will use Attrib command to hide our folders and files. Attrib allows a user to change the properties of a specified file and folder. Using attrib, the user has the capability of changing the file to have any of the below attributes:

Read only - allowing the file to be only viewed and not written to.
Archived - allowing Microsoft backup and other backup programs to know what files to backup.
Hidden - making the file invisible to standard users.
System - making the file an important system file.

How to hide files and folder using attrib command:

Open run window and type cmd, and then press enter. This will show you below Image:



Now type following command here
attrib +s +h <destination files/folder name with path>

Commands parameters are as follow:
+          Sets an attribute.
 -          Clears an attribute.
S          System file attribute.
H          Hidden file attribute.

For example, I have a folder in my D drive named sanjeev. I want to hide this folder using attrib command. So my command will be this:
attrib +s +h d:\sanjeev



Now this folder will not show to anyone even after putting check mark on ‘Show hidden files’ from the folder options.

To access this hidden folder you need to use run command and type full path of this folder as show below:



To unhide folder just put – sign in place of +

attrib –s –h <destination file/folder name with path>



Hope this will help you to protect your personal files and folder away from others.

Thanks & Regard

PRdeep Kumawat
Network & System Engineer


Difference between 32bit OS and 64 bit OS

The terms 32-bit OS and 64-bit OS refer to the way a computer’s processor (also called a CPU), handles information. The 64-bit version of Windows handles large amounts of random access memory (RAM) more effectively than a 32-bit system. That's why a 64bit OS works more fast than a 32bit OS.

Friday, January 20, 2012

How to make Windows 7 Bootable USB Pendrive


How to make Windows 7 Bootable Pendrive

Hello Friends,
Today I am telling you How to make a pendrive bootable to install Window 7 in our laptop or Desktop. There are two ways to install window in our system. Either we can boot our system by a DVD drive or we can use a pen drive.
 
First thing, you should check whether your BIOS supports booting from USB. Generally all system's bios supports USB boot. But if your BIOS doesn’t suppor, then sorry, you cannot boot your system by a USB Pendrive.
Second thing, we need a computer with OS installed with DVD drive to copy Window CD's files into the pendrive.
See all the point below:
1) Press window logo key + R and type cmd in to Run window and then press ENTER. This will launch a DOS window. The DOS screen will look like this:

2) Then type diskpart from command prompt and press enter. This will run the diskpart utility in the command prompt window, which is shown in 2nd picture below:



3) Now plug your pendrive in a USB port. Your pen drive must be atleast 4 GB to copy window 7 contents. Now go back to the diskpart console and type ‘listdisk’ and press enter. This will show you a list of various storage devices available on your system. You can see the size column of the disk and identify your PenDrive. Here in below window we can see that ‘disk 2′ is our pen drive.

4) Then you have to type ‘select disk 2′ and press enter. Note: in our case it is disk 2, in your case it may be disk 3, or disk 1 or any other number. You can identify your disk by it's size. You also can enter ‘detail disk’ to see the details of the disk after selecting it to verify that you have selected the correct disk. You can see these steps in the image below:


5) Now you have to run a series of commands. The command's order are as below:
- clean
- create partition primary
- select partition 1
- active
- format fs=fat32
These steps are shown in the image below:

6) The format step will take some time.  To format your drive quickly you can type quickly after format fs=fat32 command. But I recommand that you have to format your drive normally, not quickly. 
After the format is complete you have to run ‘assign’ command. And after this you can exit diskpart utility by entering the ‘exit’ command. The steps are shown below:
- assign
- exit

- The image below shows your all the commands typed from first step:

7) After the format is complete, put in your original Windows 7 DVD in your DVD drive, or if you have an .iso image of the DVD, mount that image using any virtual drive software like Power ISO.
- Now go to My Computer, and open the contents of DVD Drive. Press ‘ctrl+a’ to select all contents and copy all the contents by pressing ‘ctrl+c’ and paste those contents  into your USB Pen Drive by pressing 'ctrl+v.
When the copy finished, remove the USB Drive safely and use it to install Windows 7 in your computer/laptop.

Thanks & Regards,

PRdeep Kumawat
Network Engineer


Thursday, January 19, 2012

15 time-saving Windows shortcuts

Time is often of the essence when dealing with PCs, especially when a lot of IT-based work seems to involve watching progress indicators crawl across the screen.
It's vital to recoup what snippets of time you can,
and so a set of useful Windows shortcuts that help you perform common tasks is very welcome.For those tasks you carry out particularly often, consider setting a hotkey so you can launch them directly from the keyboard.


Here are 15 time-saving Windows shortcuts you should try.

1. Safely remove hardware:
A great place to start saving a few seconds is the 'Safely remove hardware' dialog, which helps you disconnect USB devices without data loss. The default method to launch this is via a small icon in the system tray, which can be fiddly and awkward to use, especially if you're in a hurry.

Here's how to make a standard shortcut that does the same job. Right-click anywhere on the desktop and choose 'New | Shortcut'. In the 'Location' box, type the following: RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll.

Provide a suitable name for the shortcut and then complete the wizard. Double-click the newly created shortcut, then select the specific device that you want to remove.

2. Install USB Ejector:
If you want a bit more control, or you'd like to produce a shortcut that ejects a specific device, you can do so with the help of some additional software.

USB Ejector is free to use, and is available from. Download and install it.

When the software is launched, you can select the device to eject. By calling it from the command line, you can specify the drive letter you want to eject and then convert the command into a shortcut. Connect your USB drive to see what letter Windows assigns to it.

Now create a new shortcut with the following in the 'Location' box: C:\path-to\USB_Disk_Eject.exe / REMOVELETTER X, where 'path-to' is the full location of the program and 'X' is the letter of the USB drive. Complete the shortcut and you'll be able to use it to eject your drive.

3. Launch a screensaver
:
If you want to launch a screensaver to obscure your screen, or just for fun, you can do so from the command line. If you convert this command to a shortcut, you can start a screensaver with a double-click.

To find the commands for the available screensavers, browse to the System32 folder, which is usually located at 'C:\Windows\ System32'. Run a search for '*. scr' and make a note of the screensaver file names.

Now return to the desktop and create a new shortcut with the full path to the screensaver of your choice, followed by the '/s' switch. For example, to launch the Mystify screensaver, enter: C:\Windows\System32\Mystify.scr /s.

4. Enable and disable transparency at will
:
Some operations work best when Aero transparency is turned off, but doing so manually takes time. You can make shortcuts to disable and re-enable transparency quickly.

To disable it, enter the following into the 'Location' field: rundll32.exe dwmApi #104. To enable it again, create a shortcut with the following in 'Location': rundll32.exe dwmApi #102.

5. Mute hotkey:
Many laptops include a mute key that lets you switch off Windows sounds easily when you're working in a public place. However, if your laptop is missing such a luxury, you can always make your own.

Start by downloading and installing the free utility NirCmd.

Right-click on the desktop and choose 'New | Shortcut'. In the location bar enter "C:\path-to\nircmd.exe" mutesysvolume 2, where 'path-to' is the full location of the 'nircmd.exe' program.

Complete the shortcut and launch it to check that it mutes the sound. Launch it again to restore sound.

Now right-click the shortcut and choose 'Properties'. On the 'Shortcut' tab, set the hotkey you want to use to launch it. You can now mute Windows at will.

6. Copy file list to clipboard:
If you need to produce a list of file names, typing them all out individually or even copying and pasting each name can be a tedious process. With a simple registry hack, you can produce a right-click menu item that copies all the file names in a folder automatically.

To try this, choose 'Start' and enter regedit in the search bar. Press [Enter]. Browse to this key: 'HKEY_CLASSES_ROOT\ Folder\shell'.

Create a new key called 'copylist', and a subkey below this called 'command'. In the 'copylist' key, right-click the default value and choose 'Modify'. Enter Copy list to clipboard. Now right-click the default value in command and choose 'Modify'. Enter the following for the value: cmd /c dir "%1" /b /a:-d /o:n | clip.

Close regedit – you can now right-click any folder to see the new menu option.

7. Clear the clipboard:
If you've recently placed a lot of data on the clipboard and no longer need it, or want it cleared for security reasons, this handy shortcut can help. It uses the 'clip.exe' utility, which is present in both Windows 7 and Vista.

To begin, right-click on the desktop and create a new shortcut. Type the following into 'Location': cmd /c "echo off | clip". Call the shortcut 'Clear clipboard'.

Right-click the new shortcut and choose 'Properties'. On the 'Shortcut' tab, set 'Run' to 'Minimised'. To help you remember what this particular shortcut does, you can give it a custom icon. Click 'Change icon' and browse to '%SystemRoot%\system32\shell32.dll'.

There are lots of different system icons available here, so select one that looks like a clipboard.

8. Copy text file contents
:
You can also make a registry edit to add a right-click menu option that copies the full contents of a text file to the clipboard without you having to open it.

Click 'Start', enter regedit into the search bar and press enter. Browse to this key: 'HKEY_CLASSES_ROOT\txtfile\shell'. Create a new key here called 'copytoclip' and set its default value to Copy file contents.

Now you need to create a subkey within this key, called 'command'. Modify this subkey's default value to this: cmd /c clip < "%1_. Close regedit and right-click a text file to test the new menu item and copy the text to the clipboard automatically.

9. Create a new folder quickly:
Press [Ctrl] + [Shift] + [N] in any Windows Explorer window using Windows 7 to create a new folder. To do the same thing in earlier versions of Windows, download and install bxNewFolder.

When you install the program, right-click and run the installer as administrator. This makes the [F12] key create a new folder.

10. Hibernate
:
If you leave your PC for more than a minute or so, you can save power by putting it into hibernation. Creating a shortcut that does this job means you can do this more easily, and even assign a hotkey to it.

Right-click the desktop and choose New, Shortcut. Enter the following as the location: C:\ Windows\System32\rundll32.exe powrprof.dll, SetSuspendState 0,1,0.

Call the shortcut 'Hibernate'. Right-click the new shortcut and choose 'Properties'. On the 'Shortcut' tab, you can then assign a hotkey and browse for a suitable icon.

11. Eject CD/DVD:
If you install the freeware NirCmd utility, you can create a shortcut that opens your CD/DVD drive tray. Set the following as the location of the shortcut: "C:\ path-to\nircmd.exe" cdrom open D:.

Replace 'path-to' with the location of the 'nircmd.exe' file. To make a shortcut to close the CD tray, use the same location but change 'open' to 'close'.

12. Switch power plans quickly:
You can create a shortcut to switch to any Windows power plan if you find its GUID. The shortcut location is: powercfg -setactive <GUID>. Replace '<GUID>' with the string of characters that Windows applies to that scheme.

You can find this out by opening a command prompt and entering powercfg -list. Right-click the background of the command window and choose 'Mark'. Select the GUID that you want to use and copy it to the clipboard.

13. Shutdown shortcut
:
Instead of going to the 'Start' menu to shut down your PC, why not create a shortcut that does the job in one operation? Set this as the location: Shutdown.exe -s -t 00.

14. Restart shortcut:
You can do exactly the same thing to produce a shortcut that restarts your PC. Just change the shortcut location to: Shutdown.exe -r -t 00.

15. Lock workstation:
Finally, if you want to lock your PC, there's a 'lock workstation' shortcut. Enter the following as the location to create it: Rundll32.exe User32. dll,LockWorkStation.