How to shutdown, restart, logoff using command prompt?

Windows provides a builtin command to shutdown, restart as well as logoff a user from the command promptne. This and many other options are provided by the “shutdown” command. In order to find out more options of any command, type :

shutdown /? – command name followed by a forward slash and a question mark.

in Command Prompt ( WIN + R ┬╗ cmd – here are some more Windows Keyboard shortcuts. You can run any command from Command Prompt or typing the command with full option into the RUN Dialog ( WIN + R ) The main use of all these commands come in batch files and task scheduling. All of these commands are pretty easy to use, please read the article completely before complaining ­čśë

Basic form of “shutdown”

The most basic form of the command is :

shutdown -OPTION
OR
shutdown /OPTION

Both perform the same thing – execute shutdown command with option OPTION. OPTION can take many values, only the ones of interest to us are mentioned here.

-l – Logs off the current user
-s – Shutdown the computer
-r – Restart the computer

-a – Aborts a current shutdown command execution

-t XX – if this is added with any of the above ones, you can specify after what time ( XX seconds ) the system should execute the OPTION.

A Simple example and a Screenshot

Here the OPTIONs specify that shutdown command should shutdown the command after 120 seconds.

RUNning “shutdown” command with options -s -t 120

shutdown -s -t 120

The screen result will be something like this :

Before shutdown, the logged in user is warned about the event and the time frame.

Canceling a shutdown

If you have given the time parameter -t XX you will have sometime before the command kicks you out. In that time, if you want to cancel the event just type :

shutdown -a -Abort a shutdown

shutdown Aborted – notification

Add a message

You can add a custom message with shutdown so that, instead of the time frame warning, the user will be presented with your message.

shutdown -s -t 120 -c “You are so screwed”

will present the user with the message – “You are so screwed” as below :

Custom message with “shutdown”

More about shutdown on Microsoft KB | Built in parental control in Windows XP

How to Disable Autoplay/Autorun

As we discussed in the last post in the series, the best way to prevent infection by a Virus is to Disable Autorun. So how do you disable Autorun? The easiest way to do this is using Group Policy Editor which is a Microsoft Management Console Object. To Turn Off AutoPlay/ AutoRun follow these steps :
Watch this step by step Flash Tutorial

1. Goto START┬╗RUN gpedit.msc

2. Browse to the folder Computer Configuration┬╗Administrative Template┬╗System.

 

goto Computer Configuration┬╗Administrative Template┬╗System


3. Scroll down and Open Turn Off Autoplay option.

4. Enable it and select All Drives

Select All Drives


This will be a system wide change. Instead if you need to turn Off Autorun just for your user account do the same in the folder –

User Configuration┬╗Administrative Template┬╗System

Please read the previous post in the series for some more useful tips on preventing Viruses.You might want to use the Address bar tip give at the end of last post in this series too.

Setting the correct aspect ratio for a video

Many a people still don’t understand what the correct aspect ratio of an image or a video is. It is the correct ratio between its width and height which will make the image look normal to the eyes and not like a print on a stretched balloon.

Wrong aspect ratio

wrong aspect ratio can destroy the beauty

 

Correct aspect ratio

CBR 1000 RR correct aspect ratio

How do you correct if a video has wrong aspect ratio.

Video :

If the aspect ratio of a video is not correct then play it in VLC media player. Goto full screen mode and press “A” on the keyboard. This will change the aspect ratio. Repeatedly press the key until the aspect ratio is OK. Alternatively you can right click the screen and goto Video>>Aspect Ratio and select an aspect ratio from the list.

o adjust the aspect ratio of an image could be done using more than one tool. I will explain this in a later post.

Setting a preferred domain for your blog

The preferred domain means the address you want your visitors to see when they come to your site. That is http://exnol.com or http://www.exnol.com in my case. you can do this easily if you are on Apache. edit the .htaccess file as follows :

RewriteEngine On
RewriteCond %{HTTP_HOST} ^YOURDOMAIN.com$ [NC]
RewriteRule ^(.*)$ http://www.YOURDOMAIN.com/$1 [R=301,L]

If an htaccess file doesn’t exist, add the above code to a text file, name it .htaccess and save it at your root directory.If ReWriteEngine On is already in your htaccess file the ignore the first line.┬á Replace YOURDOMAIN with your sites domain name. There can be problems if you use this along with

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

If you use them together some problems may occur during file access.

RewriteEngine on
This line starts the mod_rewrite module
RewriteCond %{REQUEST_FILENAME} !-d
If the request is for a real directory (one that exists on the server), index.php isn’t served.
RewriteCond %{REQUEST_FILENAME} !-f
If the request is for a file that exists already on the server, index.php isn’t served.
RewriteRule ^(.*)$ /index.php

There can be errors. I faced them while rewriting my .htaccess file but doesn’t remember the error correctly.

Setting a FAVorite ICON for your site

This post is an Answer to the comment posted by Carol A Ranney on “How to make custom icons”.

A favourite icon commonly known as a favicon is the small image shown near the URL in the address field of the browser. Now a days these icons are also used for bookmarks. You can easily create one for your web site too. Here are the steps involved :

1. Create a favicon.ico file

Use the method mentioned in How to make a custom icon. Create an icon with a size of 128×128 or larger dimension which you can work easily on. Now scale it down to 16x16px. It is better to use 256 colors only. Save his as favicon.ico

2. Upload the icon

If you are the admin then upload the icon to the root directory of your web site. This is normally public_html or where the index.html file lies.

You will be able to see the icon for all the pages from your web site now.

3. Adding a <link> field

If you want to use a different icon for a particular page add

<link rel="shortcut icon" href="ICON" type="image/x-icon" />

in between the <head></head> tags of the page where icon location refers to PATH/favicon.ico the place where you saved the icon.

4. More on favicons

Most of the current browsers also support GIF files as favicons. Use the name favicon.gif if you are using one. You can use animated icons by saving the animation as a GIF file and then use it as your favicon. Firefox even supports png file to be used as favourite icon.

If you have any further doubts please feel free to comment here.

Add free online contact form to your web site

A Contact form is an essential form for any website. But if you are on blogger or a free host you wont be able to create one on yourself even if you know PHP. Although if you are running WP you can get plugin’s specific for that application. I use cForms for my contact forms.

So if you just need a frills free contact form you can place on your website you may try Contactify . It offers free contact forms as well as spam protection (word verification) for the service. You just need to copy paste the JavaScript they provide after you register.

Here is my sample contact form : Contact me

Points to note while upgrading to an LCD flat panel display

An LCD flat panel display is much better for your eyes if you spend a lot of time in front of a computer. If you spend a little more money than a CRT monitor you can get a sleek ,light and less power hungry LCD TFT display. I was recently searching for an LCD monitor and finally bought the HP 1908w 19″. So I was forced to do a little research (lol) in the area. I am sharing it because some of you may get some benefit from it.

HP 1908w TFT screen

Size :

If you are using the LCD for daily work and not for group entertainment (like a movie) you will not need much larger than a 19″ screen (or may be 22″ if you go that far).

Aspect ration :

Aspect ratio is the ratio of width and height of your screen. 4:3 means for 4 units of width 3 units of height is taken (like 1024x 768 is 256x4 and 256x3). If you like to use your monitor mainly to watch movies go for a 16:10 wide screen aspect ratio. You can get 16:9 also on some Samsung models. If you plan to use it mainly for document editing and office work it would be better to go for an aspect ratio of 5:4 (10280×1024).

Response time :

Response time would not be much of a concern to you unless you are a die hard gamer. If you are then go for something like 5ms or faster (3ms). The Gray to Gray response time is more of a use to the customer actualy.

Contrast :

To put it in simple terms contrast is the intensity difference between Black and White pixels. Go for higher contrast.

Brightness :

Here also the higher the better. but never settle for anything lower than approximately 280cd/m^2.

Connectors :

VGA the 15 pin connector is a standard. Go for DVI or even HDMI ports. Here even if you don’t have a graphics card that supports DVI you can use the monitor with the VGA cable. (VGA is th 12 pin connector – normally blue that you can connect to the onboard graphics of any computer).

Price :

Here in India you can get a decent 19″ LCD screen for upward of 220 US dollars. If you need more features you got to spend more.

Bottom Line

Go for LCD monitors as they provide you with maximum screen size(viewable) in any size class. If you are a professional designer or something there are only very few LCD TFT screens that can compete with CRTs as of now. Search for more than three manufacturers and in more as many shops as you can. Always ask for a demo of the product if you haven’t seen one of the models before. Use the monitor in a dark room also if possible. Play a movie and also ask for the warranty details.

Windows virus infects Linux

Windows has always been considered a vulnerable OS to viruses, but not Linux. I haven’t heared about any virus for Linux except for some university project somewhere. So do not expect me to discover a new virus for Linux. This is much more interesting, actually.

The virus I found, running, on Linux (Ubuntu to be specific) was actually a Windows virus. Some of you might already have figured out the culprit here. So how did the Windows virus manage to run on Linux which doesn’t even support any Windows specific file.

A windows virus running in Linux
A windows virus running in Linux (Ubuntu)

Wine is a software application which allows Unix like OSes to run programs written for Windows. So if you set the default assocaiation for exe files to Wine in Linux, you can just double click on exe files and run them just like you do in Windows. So if this is right then you can get infected with almost any Windows Virus in Linux.. although the consequences may not be much important.

[Screen Shot soon]

Any Virus using AutoPlay can infect by this method. So if the virus is running after you inserted a USB drive it will copy itself to any external storage device automatically. So virtually you get your USB drive infected with virus from a LINUX system. To prevent this from happeneing do not set the default association for exe file to Wine. Just leave it in the Open with list and chose it when you need to run an exe file.

The removal and detection could be understood from the screen shot provided. Click on the screen shot for a bigger one with more details.

Virus infection by autoplay, how to prevent it

One of the main reasons of rapid spreading of viruses is due to the presence of Autoplay in Windows. Autoplay feature was originally introduced to enhance user experience. An easy way for a virus to enters a PC is through exploiting this option. You can see Autoplay in action when a driver CD of you Motherboard or a Printer start its installation process as soon as you inserts it. Here let us look at how Autorun can be added to a drive (CD, USB, HSS etc..) and make it Windows open a program automatically when you puts it in or double clicks it.

Adding Autoplay to any drive is as easy as creating a text file and typing some commands into it. Have a look at the Autorun.inf file (this makes Windows run programs automatically from CDs) of the Microsoft Office 2007 CD.

Autorun file can add options to the default right click menu.

The Right Click menu has been modified according to the entries in the autorun.inf file. The file need to be saved with the name Autorun.inf  The bad part is that autoplay can be added to any drive. And a virus can create an autorun file in a USB drive inserted into an infected system. It then makes the autorun file such that not only does the autoplay option open an infected file but the Open and Explore commands in the right click menu will also do the same.

This is the Screen shot of an Autorun.inf file created by the virus Infostealer.Wowcraft.D virus

An autorun file created by a Virus

It will automatically install itself with out you ever knowing, if autoplay is enabled. You might have figured out how easy a virus can infect a Windows based system.

Prevention :

As they say prvention is better than cure. Here are some steps you can take to prevent infection of viruses due to Autoplay.

1. Disable autoplay

2. Always Open a CD or Pen Drive (USB stick) by using the pull down menu of your address bar. You can also type the drive letter followed by a “ : ”┬á eg. D: in the address bar or Run box and press enter.

More about disabling autoplay will be posted in the next post.

Open and save Office 2007 files in Office XP and 2003

The easiest way to enable support for the new Office 2007 file formats in Office XP is to install the Migration pack provided by Microsoft free of cost. With the introduction of the XML standard in file format, the new files with extensions ending in x (docx, xslx, pptx) will not be compatible with the older Microsoft Office.

With Migration pack installed you can either save in all the New office supported formats as well as open all the new format files. Here is a screen shot of the Save As dialogue in Office XP with 2007 compatibility pack installed.

Office-word-save-as-2007

Main advantages f the new file format are that it is a standard XML format and also the compression ratio is better for the XML formats. You can open all the 2007 Office files using any archiving tool.

The Office 1007 compatibility pack is free of cost and can be downloaded form Microsoft Download center. You must install all High Priority updates from Microsoft update center before installing this pack. Here is the Office 2007 compatibility pack download page at Microsoft Download Center. The file is a 27.5Mb Windows Executable.