Firstly Thanx a lot for ur help.
I knew to do it via count but it wud have taken me more time so once again thanx for ur help.
Now this runs perfectly fine, but I have to insert username & password, so is it possible to do that in the code, so tht it accepts username & password automatically for win7 & win2008 r2
Lastly in the last count is it possible to shutdown the system instead of not doing anything.
Your help is much appreciated.