fix sudo behavior for windows (fix #2137)