Run it in new postgres bin folder
pg_upgrade.exe
-b D:\database\PostgreSQL-9.5-x64\bin -- old postgres bin folder without end slash
-B D:\database\PostgreSQL-10.7-x64\bin -- new postgres bin folder without end slash
-d D:\cluster\PostgreSQL-9.5-x64 -- old postgres cluster data folder without end slash
-D D:\cluster\PostgreSQL-10.7-x64 -- new postgres cluster data folder without end slash
-U postgres