The script is used to work well on Windows 7 and when I switched to Windows 10, it no longer works. For Windows 10, there is several encryption software you can consider, such as BitLocker, Folder unbreaker, Veracrypt, PGP4win etc.
Credit: https://www.tunesbro.com/password-protect-a-folder-windows-10.html