Hello @hosein farahani
I believe this article will help you to identify and troubleshoot the issue:
You can also compare the registry keys in: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters compared to a machine that doesn't lose the IP settings, as it is possible that some registry keys are not automatically created for virtual switches.
Hope this helps with your query,
----
--If the reply is helpful, please Upvote and Accept as answer--