How to rename Windows shared folder name by C++/CMD

I have a folder "C:\myshare" which is shared as name "Sharing" in network.
Other computer can access this folder via "\\{IP address}\Sharing.".
I need to temporary rename the shared folder to another name (e.g. "Sharing_2") so that other computer can't access. However, the folder "C:\myshare" need remain unchanged (no rename).
After some checking, I need to rename the shared folder back to "Sharing" so that other computer can access.

How can I do this task, by either Command Line, or C++ if possible?