The script fails if a Temp directory is not present in the system drive (e.g. C:\Temp). This can be solved by using the TEMP environment variable instead.