How to reduce repeated task in windows