Follow avpblogs on Twitter
Home About Best Of The Blog

Recent articles

How to see environment variables with set command  

How do you find out the domain name,the user name of currently logged in user and the path where user profile is stored using just a single command?

Well,this can be done because of the very helpful set command available from Windows command prompt.

In one of my earlier posts,I had described using the set command to check the domain controller availability in a domain based environment.

Here,let's find out the other useful functions of set.

Open command prompt ( Start > Run > cmd)

Type - "set u" and hit Enter.



In fact,if we want to see environment variables starting with a particular letter,the same command can be applied as set followed by the letter like set a.



Typing set a will show variables beginning with a,in this case it will point out useful info of All Users in Windows as well as the path of Application Data.

For getting a quick look at what set command is all about,type set /? :



Feel free to try out different combinations of set,it will be a time saver.

Peace.

| More

How to make external USB drives go faster in Vista  

Any external USB drive connected in Windows Vista by default is optimized for quick removal and not quick performance.
This is because it is assumed that any plugged in external drive will be removed at some point of time and a quick removal from the computer may result in data loss.

What if you use an external USB disk that is always connected to your computer?
In this case,we can optimize the USB disk performance by simply enabling "write caching" in Vista.

Fire up Device Manager by going to Start > Run > devmgmt.msc



Drill down to Disk drives and locate your external USB disk.Double click on disk icon and go to Policies.




Here,change the option from Optimize for quick removal to Optimize for performance.

Hit Ok,and restart Vista for changes to take full effect.

Hope this has been an informative post.

Peace.

| More

Turn off superfetch in Vista from command prompt  

Vista has this service turned on by default called "Superfetch".What this does is keep track of user patterns like which are the most commonly used applications and on startup,load these frequently used applications first for logged in user.

Just like all the Windows services,this too can be turned off or on if you want to explore the performance difference of your Vista system.

Let's take a look at how to turn this service off from command prompt.

Go to Start > Run > cmd

To turn the service off,type :
net stop superfetch

And to turn it back on :
net start superfetch



Feel free to experiment the enabling and disabling of this service and check if it makes a difference in speed of Windows Vista.

Peace.

| More

Creating email message shortcut in Windows  

On surfing the web,we often come across email addresses as hyperlinks which on clicking will launch email client with the clicked address as the recipient.

Is there any way,we can do the same on demand by making a desktop shortcut of any intended recipient and also copying some one else's email address in one go ?

Yes,there is an easy way to do this.We just need to extend the web based email strings in our shortcut creation.

The email links that are used on webpages use format like this :
mailto:toaddress?cc=ccaddress&bcc=bccaddress

This same thing can be put up as a desktop shortcut,let's take a look how.

Right click on desktop where the shortcut needs to be placed,select New > Shortcut.

I will assume I need to create a shortcut that will send email to recipent avp@mail.org and copying recipient avp@support.org.



In the box where location of the item needs to be filled,following is entered :
mailto:avp@mail.org?cc=avp@support.org

Clicking next will prompt for saving the shortcut which can be given any sensible name.

Once the shortcut is saved,double clicking it will open the default email client with already filled email addresses.






This can be extended further if you are sending daily emails with a fixed subject line,the procedure for creating the shortcut remains the same,the syntax will change as :

mailto:email@address.com?cc=email2@address.com?subject=some subject

This will pop up a blank email message with to,cc and subject fields already filled up.

Hope this has been an informative post.

| More

Quick way to check Windows time zone and sync to internet server  

Having correct time is important,be it in life in general or Windows in particular.

In a domain based environment,there is something called as a time skew which means that if system clock on a client Windows machine is not in sync with the time on domain controller by more than 5 minutes,kerberos authentication will fail and domain user can't logon to that system anymore.

There are few useful commands that can be used quickly to see what time zone is being used and synchronizing the time on local Windows system to that of any of the internet time servers.

First we take a look at what time zone our Windows machine is in by going to command prompt and typing : w32tm / tz




Synchronizing our Windows machine to the accurate time of any internet time server (of course,the computer needs to be connected to internet for this),can be done by typing - w32tm /resync.

All done,remember time is precious :)

Peace.

| More

How to make administrator shortcuts to avoid UAC in Vista  

Task Scheduler in Windows is perhaps one of the most under utilized tools that I have known so far.Knowing it can make using Windows more fun and of course more interesting.

Windows Vista and it's UAC prevents applications from running without admin privileges.
Although UAC can be disabled,many times it is not feasible for running just a single application that needs admin access.

Task scheduler comes to the rescue.What we will do is make a scheduled task that launches the application we desire with administrator rights,make the task accessible by creating a shortcut and finally using the application without UAC reminding us of entering administrator rights ever again for that application.

I will use Ccleaner here for illustration.

It is quite simple,let's take a look how :

Launch Windows Task Scheduler ( Start > Programs > Accessories > System Tools > Task Scheduler)




Make a new task by clicking on create task - this will be in this case launching CCleaner with administrative privileges.In General tab,check mark the option "Run with highest privileges".

We will name this task as Launch_ccleaner.



In Actions tab,we will need to specify the executable of the application we are trying to run,in this case it's ccleaner.exe



Let's check if the task created shows up in task scheduler.



Till here,what we have done is made a task and associated it with the application to be run.

Now comes the shortcut for the created task.We need to create a shortcut to the above mentioned task on desktop from where we can run it.

The basic usage of running a task is :
schtasks /run /tn "taskname"

Here we will type :
schtasks /run /tn "Launch_ccleaner"




The shortcut is now created which on double clicking will always run CCleaner in administrator mode.No UAC popups will be seen while doing this as the task itself is run with admin rights irrespective of user logged on.

Isn't task scheduler fun from Windows security perspective ?

Peace.

| More

Ways to open command prompt with admin access in Vista  

In my earlier post on security features in Windows Vista,I had described how to turn off User Account Control.

What if we want to run applications with normal user rights but only need the command prompt to be launched with elevated administrator rights?

There are two ways that I have come across to launch command prompt with administrator access,as usual there is the graphical click way and the other is a keyboard combo that does that.

For making command prompt run with administrator access,the simplest way is the graphical way.

Right click the command prompt icon and select 'Run as administrator" option.



On selecting this,command prompt will open with elevated rights (if UAC is not turned off,you will be required to enter admin credentials).



Now the other way.

Go to Start > Run,type cmd.
Don't hit Enter yet,instead use the keyboard combination of Ctrl+Shift+Enter.
This too will have the same effect of launching command prompt with administrator rights.

Which way do you think is more cleaner and cooler ?

Peace.

| More

Making Service Pack 1 permanent in Windows Vista  

When installing service pack 1 under Windows Vista,a way of uninstalling is also embedded by default should you at any later point of time need to remove the service pack.

What if we no longer need to uninstall service pack,the setup files in this case can be safely removed thereby freeing up disk space in Vista.

Go to Start > Run.

Type the following command :

vsp1cln.exe

This needs to be run under administrative privileges.



The following dialog box will pop up for confirmation :



On typing 'y',it will remove the associated uninstaller of service pack thereby making it permanent on your computer.

Once this command is executed,removal of service pack 1 will no longer be possible in Windows Vista.If you really are not sure whether to make service pack permanent or not,it is suggested that you leave the uninstaller as it is.

Hope this has been an informative post.

Peace.

| More

How to open folder specific command prompt in Windows Vista  

It is possible to spawn a command prompt referencing a specific folder only in Windows Vista.What this means is if we want to open a command prompt that has the path of the specific folder we wish,we can do that which is quite cool.

To do this :

1. Select any folder whose path needs to be opened at command prompt path.Here,I will select a folder named Music!

2. Right click on the folder while holding down Shift key.



3. Select the Open Command Window Here option.This will launch a command prompt for the selected folder path with the privileges of the user logged in.




To make the command window open with privileges of Administrator,check out this link.

However,if you decide to tweak using the above link,then do keep in mind that this will elevate rights for any logged in user to gain access to command prompt with full Administrator rights.

Hope this has been an informative post.

Peace

| More

Viewing duplicate songs in itunes  

As the music collection on your hard drive increases,chances are there will be a lot of duplicate songs within the same playlist.

How do we go about trimming the music collection and find out which songs are duplicates or repeated?

Itunes helps in this regard.If we have a playlist in itunes,there is a nifty feature that will check for duplicates and using it is quite simple.

Here is how :

1. Fire up itunes.

2. Click on the Music tab and then,hit View > Show Duplicates in Windows or File > Show Duplicates in Mac.



3.This will show only the songs that are repeated in your entire collection.




4.Return back to the original list using Show All button.

Peace.

| More

Using the drag and drop feature of Windows Mail  

Windows Mail in Vista provides an in-built drag and drop functionality which makes it possible to simply drag text from any open document and drop it in any folder within Windows Mail except the outbox.

Let's take a quick tour on how to do this :

1. Launch Windows Mail (Start > Run > winmail.exe)

2.Open any text editor - wordpad (Start > Run > wordpad.exe) will also do just fine.

3.Type the desired text which needs to be sent as email in the text editor.

4.Highlight the text block,move the mouse pointer to Windows Mail,the pointer will change its appearance to a block.



5. Drop the text block in any folder except Outbox in Windows Mail.



6.The drop of the text block will pop up an email message with the selected text which can be sent in a jiffy to intended recipients.

Hope this has been an informative post.

| More

Removing Windows messenger from XP  

An old hack but is still useful to remove Windows Messenger from Windows XP.
By default,it can't be removed from XP but we can do it by changing a few attributes.

Windows Messenger doesn't show up by default as below :



First,we need to make the Windows Messenger component visible in Add/Remove Windows components.To do this :

1.Navigate to C:\Windows\inf\sysoc.inf




2.Change the line msmsgs=msgrocm.dll,OcEntry,msmsgs.inf,hide,7 to
msmsgs=msgrocm.dll,OcEntry,msmsgs.inf,7

3.Save the modified sysoc.inf file.(if needed you can first backup this file by copying and storing it somewhere else).



4.Go to Start > Settings > Control Panel> Add Remove Programs.Over there launch Add remove Windows components and scroll down to find Windows Messenger entry listed with it's size.



5.Uncheck it and click Next to remove.

6.All done.

Hope it has been an informative post.

Peace.

| More

How to export Gmail contacts to Windows mail  

Recently I decided to try using Windows Mail client for a change.

So I configured POP/SMTP settings in Windows mail client and also enabled POP in Gmail account settings.It worked and email started flowing in Windows Mail but composing new emails became a pain as none of the contacts present in Gmail were setup by default in Windows Mail.

To get all your gmail contacts to Windows mail we basically need to export them from the gmail account in form of a csv file and import that file in Windows Mail.

Here is how that can be done:

Exporting contacts from gmail


1. Sign in to Gmail.

2. Click Contacts along the side of any Gmail page.



3. Click Export at the top of your Contacts list.

4. Choose whether to export all contacts or only one group.

5. Select the format in which you'd like to export your contacts' information.Here we will use Outlook csv format.



6. Click Export.

7. Choose Save to Disk then click OK.



8. Select a location to save your file, and click 'OK.'

Importing contacts to Windows Mail :

1. Open Windows Mail (Start>Programs>Windows Mail).

2. Click File > Import > Windows Contacts.



3. Choose csv format.

4. Point to the location where you had saved the exported contacts from gmail.



5. All done,check out the imported contacts by typing a partial contact name and hitting Ctrl-K,you should be displayed list of contacts accordingly.

Hope this has been an informative post.

Peace.

| More

Making IE6 run in full screen - always  

Here is a registry hack useful for XP machines that are used in lobby or for some display purposes that use internet explorer.

Let's take a look at how to always run Internet Explorer 6 in full mode:

1. Open registry editor (Start>Run>regedt32.exe)

2. Navigate to HKEY_CURRENT_USER>Console, find 'fullscreen' change the value from 0 to
1.



3. Navigate to HKEY_CURRENT_USER>Software>Microsoft>InternetExplorer>Main, change 'fullscreen' value from no to yes.




4.Reboot and launch IE 6,it will now be in full screen mode.



Peace.

| More

Using tree command  

Suppose we need to find out quickly what all sub directories with their files are under a directory without going to Windows explorer to do that or even using the dir command.Is it possible?


Yes indeed.We can find out the details from the beloved command prompt using the "tree".
This command comes in handy when we want to list only a particular file or similar file types from a lot of files under some directory.

Let's take a look to clarify this :

1.Like most online users,I download a lot of stuff,finding what I want in the default Downloads folder can be a pain sometimes.

2.Let's say I want to find out if I have downloaded some .txt files in Downloads folder.(Of course the graphical way here would be to double click Downloads folder and then list files by type or by doing a cd to that directory and then listing file type with wildcards,but remember we want to complete this just from the command prompt with least effort and from the current directory we are in).

3.I launch the command prompt (Start>Run>cmd).


4.Tree comes into play - listing the path I want to scan files for (C:\Users\AVP\Downloads) in this case with the /f switch in command prompt to list all the files too within the sub directories.

5.Since I want to see if I have any text files that I had downloaded recently,the next step would be to use find command to filter our output so that files with only the .txt extension will be listed.

The command which will do all of the above will be :

C:\Users\AVP\Downloads>tree "c:\Users\AVP\Downloads"
/f|find ".txt"


I see the following output once I give the above command :




As seen tree can be very useful,I will give one more example to make this clear.

Suppose I want to see what files I have within a nested sub folder of a main folder from the command prompt.

Here is what I do :




Hope this has been an informative post.

Peace.

| More

Creating a systems diagnostics report in Vista  

Windows Vista comes with some really neat features and systems diagnostics report is one of them.

Periodic monitoring of system helps us in determining it's bottlenecks and resolving potential problems that it might face.

Reliability and Performance Monitor in Windows Vista gives us a neat detailed view of our system - its potential bottlenecks and the stuff that is already configured / optimized.

One feature of Reliability and Performance Monitor is the system and health report functionality.
It works by basically collecting data on various parameters of Vista for 60 seconds and then displays a report indicating what is lacking or what is already present from a performance tuning perspective.

Let's take a look at how to get this report :

1. Navigate to Control Panel > Performance Information and Tools > Advanced Tools.



2. Select the Generate a system health report.

3. Once launched,it will for 60 seconds collect information about the system.



4. Once the diagnostics is finished,a report is displayed showing areas of concern and areas that require no tune up.



5. It is advisable to save this somewhere so that it serves as a baseline for future diagnostics to ensure that Vista is running as expected.

Hope this has been an informative post.

Peace.

| More

How to backup registry settings in XP/Vista  

In one of my earlier posts,I had described the way to backup registry through the system state data backup.

Let us take a look on how to go about if we only need to backup registry and nothing else.

1.Open registry editor (Start>Run>regedt32).



2.We will export the current registry settings and save it as a .reg file somewhere.
To do this,click File>Export.



3.Choose a suitable location to store this exported registry file,you may never know when it can come in handy :)



4.If possible,store multiple copies of this file in multiple storage devices to improve redundancy.

For Vista,administrator privileges will be needed to open registry editor.The procedure for backup remains the same as in XP.

If more information on what .reg file is and how to use it,check this post on it.

Peace.

| More

Disabling/enabling UAC in Vista - the click click way and the type type way  

User Account Control is a new security feature in Windows Vista to prevent execution of unauthorized applications.
If tired of annoying popups that seem to come when you try to run any application in Vista,it means UAC is in charge of your access.
I will show two ways to disable UAC in Windows Vista -the graphical or clicking way and of course the command prompt way.

Let's first take a look at the graphical way :

Access Control Panel>User Accounts.
Click on Turn User Account Control on or off.



This will bring up a new window,remove the tick mark from the box which displays Use User Account Control (UAC) to help protect your computer.


Click Ok and reboot the machine once.

All done,no more annoying popups from UAC.

And now,the command prompt way - this is quicker and looks cool too :

Access command prompt (Start>Run>command prompt).
Copy paste the following command :

C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f

This has to be done after launching the command prompt with administrative rights else the error message Access denied will be seen.

Reboot and experience the freedom.

In case,if UAC needs to be turned back on,simply put a click in the UAC option box and hit OK.

For doing the same through command prompt,use the following command from command prompt :

C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f

Just to give an idea about why the command prompt way is much quicker - the command that is entered will basically use registry editor to change the value of registry key that controls UAC to either 0 (which is UAC disabled) or 1 (which is UAC enabled).

Isn't binary world wonderful - 2 choices for everything :) ?

Peace.

| More

How to use Windows Defender  

Windows Vista comes with in-built antispyware and antimalware application - Windows Defender (the gray coloured wall icon).
Defender proves to be much useful than just tracking down spyware and malware present in a Vista box.

Let's take a look at what more it can do apart from just running in background checking for malware and spyware traces.

1.Launch Defender from Control Panel>Security Center>Windows Defender.



2.The interface within this which we want to get to is the Software Explorer.



3.The Software Explorer is like a detailed process viewer and also offers category wise view of applications running on Vista.



4.Startup programs can be disabled or removed from within this interface making it much convenient then msconfig in previous versions of Windows.



5.Total network traffic per application can also be blocked or allowed from this interface which is very cool.



As with all security applications,Defender will also need regular updates for it's definitions,so best to keep it updated at regular intervals.

Hope this has been an informative post.

Peace.

| More