these scripts (SetRDPLevelCM4.bat and SetRDPLevelCM0.bat) are made to unlock STM32WL boards under windows by writing directly in OPTR register.
to make them working under Linux and Macos please do the needed modifications.
In addition to these scripts there is an other script (UnlockChip.bat) using the usual methode to set option bytes using the command -ob.