How to silently create an asset in c++

How to silently create an asset in c++ and directly overwrite it if an asset with the same name already exists without showing a dialog? I have tried deleting the existing asset, but I couldn’t completely remove it, which causes an exception when attempting to create it again.