Archive

Posts Tagged ‘windows 7’

Windows 7: Unveil hidden themes

Windows 7 comes with a few default themes which you can view from “Control Panel” -> “Appearance and Personalization” -> “Change the theme”. While exploring something today, I came across a hidden location where a few more window 7 themes are available.

To access the location, go to start -> Run and type “c:\Windows\Globalization\mct”. This lists the folders and here you can see the themes for “AU – Australia”, “CA- Canada”, “US – United States”, “GB – United Kingdom”,  and “ZA – South Africa”. Out of these we generally see United Stated theme only in control panel. This is because of most of us select Country/language as US during the installation. If we choose some other country during the installation, the respective theme will get added.

If you like any theme in these hidden ones, just go to that folder and execute the file inside themes folder to install and activate it. I liked ZA theme among them :-)

 

Hey PowerShell, What is my laptop battery status?

Yesterday I wrote about different ways to check how much charge is left in the laptop battery. After that I explored win32_battery WMI class further and got some more useful information.

How do you know your battery current status, like is it charging properly?, is it running low, it is full with charge, it is partially charged, is the charge is too low?. It is easy to answer this kind of questions if you can interpret batterystatus attribute of Win32_Battery WMI class. Let us see the possible values this attribute can hold and their meaning.

Value Meaning
1
The battery is discharging.
2
The system has access to AC so no battery is being discharged. However, the battery is not necessarily charging.
3
Fully Charged
4
Low
5
Critical
6
Charging
7
Charging and High
8
Charging and Low
9
Charging and Critical
10
Undefined
11
Partially Charged

*Above table is copied from MSDN site.

Now let us write a script to check the battery current status.

Function Check-BatteryState {
param($Laptop=$env:computername)
$Bstatus = (Get-WmiObject -Class Win32_Battery -ea 0).BatteryStatus
if($Bstatus) {
    switch ($Bstatus)
    {
    1 { "Battery is discharging" }
    2 { "The system has access to AC so no battery is being discharged. However, the battery is not necessarily charging." }
    3 { "Fully Charged" }
    4 { "Low" }
    5 { "Critical" }
    6 { "Charging" }
    7 { "Charging and High" }
    8 { "Charging and Low" }
    9 { "Charging and Critical " }
    10 { "Unknown State" }
    11 { "Partially Charged" }            

    }
}
}

This powershell function helps you to identify current status of laptop battery. Hope this helps..


Powershell: Check laptop battery status

June 30, 2011 1 comment

In this post, I will show you how to pragmatically query battery status in laptops using powershell. It is important to check batter status before performing some critical tasks like patch updates or service pack updates via some automation(s). If the laptop charging drains down in middle of the upgrade, it can corrupt the operating system.

You can use below one liner to check the percentage of charging left in the battery:

(Get-WmiObject -Class Win32_Battery).estimatedchargeremaining

Similarly, if you want to how many more minutes this charging comes, you can use below code:

(Get-WmiObject -Class Win32_Battery).EstimatedRunTime

Hope this helps and you will have crash free upgrades on laptops.

How to backup and restore Sticky notes in Windows 7

 

Backup Procedure:

  1. Go to Start -> Run and type “%appdata%MicrosoftSticky Notes” and Click “OK”
  2. This opens the location of Sticky Notes file, “StickyNotes.snt”, where all the sticky notes data is stored.
  3. Just take a copy of this file and save it somewhere safe.

Procedure to Restore:

Restoring Sticky notes is as good as copying back the file that you saved in safe location. Just copy the backed up file to “%appdata%MicrosoftStickyNotes” folder.

Hope this helps.

Wake on LAN is not working in Windows 7 — Found the solution

I have been struggling for a while to identify why Wake On LAN is not working since I installed Windows 7 on my computer. It worked fine with Windows XP but after moving to windows 7, it never worked. After lot of testing and trying various things, I finally reached the solution.

So, here you go…

There is something called PME(Power Management Event) in Network connection properties which should be in enabled state to make your Windows 7 computer process the magic packets to wake up your computer.

To enable PME, follow the below steps.

  •  Go to Start -> Run -> Type “ncpa.cpl” and click OK
  • This opens up the network connections available in the computer. Here identify the NIC on which your computer will receive magic packets and go the properties of it.

  • Click on Configure and Switch to advanced tab and select “Enable PME” property list and change the value to “Enable”

  • Click on OK to complete the configuration.

This will make your network connection to blip briefly. Once your network connection is back your computer is ready to process the WOL packets. Shutdown your computer and try sending magic packet again. It should work without any issues.

Relavant articles:

http://www.intel.com/support/network/sb/cs-008459.htm

Feel free to post any questions that you have about WOL in windows.

Categories: Windows 7 Tags:

Disable TCP/IP “Auto Tuning” in windows 7/vista/windows 2008 R2

April 13, 2011 2 comments

Since last one and half year, I have been working on Windows 7 Operating system and in my experience “Auto Tuning” in windows 7/vista/windows 2008 R2 is the most possible culprit for any network related problems. If you see a network related problem in these operating systems and cannot determine what is the cause, I suggest you try disabling “auto tuning” first.

I know that “auto tuning” is one of the features introduced with windows 7/vista to improve OS operations on network. Basically what it does is, it adjusts the TCP window size to improve the network operations. Though it sounds good in theory, I have seen numerous amount of posts over internet where disabling “auto tuning” addressed many issues like, slow data copy, slowness in email delivery, slow outlook mail caching times, and a few application data transfer related issues. Most of these issues you will see when performing the transfer operations over a WAN link.

So, considering above all, I would like to share the procedure for disabling/enabling “Auto Tuning” in windows 7 environment which may come handy for you in troubleshooting network related issues…

Procedure:

  1. Open Command prompt with elevated rights
  2. Run the command netsh interface tcp set global autotuning=disabled
  3. This disables the auto tuning
  4. Similar to enable auto tuning back, use the command netsh interface tcp set global autotuningl=normal

 If you want to see the current status of auto tuning, use netsh interface tcp show global

Hope this helps you.

Categories: Windows 7 Tags: ,

Block installation of Windows 7/Windows 2008 R2 Service Pack 1

Microsoft has released a tool which helps you in blocking the installation of Windows 7/Windows 2008 R2 Service Pack 1 through windows Updates. You can download it from here.

This download contains three files.

1. SPBlockingTool.exe — A microsoft executable

2. SPReg.bat  –  A batch script

3. NoSPUpdate.ADM — A ADM file to use with GPOs

The installation of service pack 1 through Windows Update can be stopped with one of the above above given tools. If you plan to use the executable, you need to pass /B switch to it to block the installation and /U switch to unblock the installation. Similar functionality can be achieved with BAT script also. It helps you to run against remote system as well. Third approach is using the ADM file in your Group Policies. This GPO procedure is very straight forward and like using any other ADM file.

Irrespective of approach you use, it creates a key value name “DoNotAllowSP” and sets it to “1” under HKLMSoftwarePoliciesMicrosoftWindowsWindowsUpdate registry key to block the installation. It deletes this newly created key when you instruct it to unblock the installation restriction.

Hope this helps you.

Categories: Tips, Windows 2008, Windows 7 Tags:

Query for error events in Event log using PowerShell

PowerShell has a built in cmdlet(Get-Eventlog) which directly interacts with Event Viewer. You can query the data in the way you want using this cmdlet. Below are some of the examples…

Get-Eventlog -logName System

This queries all events in System event.

Get-EventLog -LogName System | ? {$_.Entrytype -match “error” }

This queries all error events in System event viewer.

$fromtime = (get-date).Adddays(-1)

Get-EventLog -LogName System | ? {$_.Entrytype -match “error” -and $_.timegenerated -gt $fromtime }

This queries all error events in last one day. You can similarly use the methods of (get-date) to query events in last few seconds, minutes, hours, days, etc.

Drag Drop not working in windows 7

I have seen this problem randomly on my windows 7 computer. After close observation, I found that DRAG and DROP won’t work from low privileged window to High privileged window. I generally run a command prompt with administrator and try to drag drop items from my explorer to the elevated command prompt. Since the elevated command prompt is running in high privilege mode, and my explorer in low privilege mode, drap-drop from explorer to cmd is not working. Whereas same operation to a normal command prompt is working without any issues since it is in the same privilege mode as my explorer.

I hope this small briefing helps you come out of drap-drop dilemma.

Btw, command prompt appears like below when it is in high privilege mode.

 

Categories: Tips, Windows 7 Tags:

Pin applications to Task bar using powershell

August 11, 2010 1 comment

Description:

This powershell function helps you pinning the specified program to Task bar in windows 7/Windows Vista/Windows 2008 computers.

Usage:

[PS]:>Pinto-Taskbar -application “c:windowssystem32calc.exe”

The above statement Pins the calculator program to Task bar.

Code:

function pinto-taskbar {

param(

[parameter(Mandatory = $true)]

[string]$application

)

$appfolderpath = $application.SubString(0,$application.Length-($application.Split(“”)[$application.Split("").Count-1].Length))

$objshell = New-Object -ComObject “Shell.Application”

$objfolder = $objshell.Namespace($appfolderpath)

$appname = $objfolder.ParseName($application.SubString($application.Length-($application.Split(“”)[$application.Split("").Count-1].Length)))

$verbs = $appname.verbs()

foreach ($verb in $verbs) {

if($verb.name.replace(“&”,”") -match “Pin to Taskbar”) {

$verb.DoIt()

}

}

}