There is no flag, option, or attribute that would prevent generic USB drives from being erased or formatted.
(That said, you might find various vendor-specific "factory configuration" tools, depending on the actual flash chip that's inside the drive – e.g. UT165 MPTool works with many Kingston drives and offers many features, including read-only mode, custom partitions, and so on. But others only have basic "format" options.)
The +R "read-only" attribute does not write-protect a drive. It protects only individual files, and it is trivial to unset the same way.
Also, the attribute is persistent – once set on a given file, it remains set, no matter where you connect that drive, and no matter what drive letter it has. You don't need a batch file
If you do need a batch file for some task, %0
has the full path of the batch file itself, and it can be modified to %~d0
for the drive letter, %~dp0
for drive+directory, and so on.