Little known fact about WPI is that generate.js needs to look for the same file that wpi.cmd looks for and since you have wpi.cmd looking for cd.txt generate.js needs to look for that file also. I modified yours to read this change and for future reference just open generate.js and look for wpi.ico or win51 and replace it with the proper context. (there are 2 spots)