small windows script improvement