I have a case. All computers are in the same LAN network(192.168.1.0/24, default gateway 192.168.1.1) and same workgroup. They see each other in network places and can access to shared folders. But if I change only default gateway of some PCs to 192.168.1.100, these PCs cant see those PCs whose default gateway unchanged and vice versa. But PC with 192.168.1.100 router can access another PC with 192.168.1.1 manually (in cmd: \192.168.1.x) How to make it that all PCs can see each other?
Changing the default gateway of the devices will most likely put them into their Public network profile*. Windows Firewall's default settings disable network discovery for computers in this profile, explaining the behavior you're experiencing.
Unless you have multiple valid gateways on your network (which is highly unusual), you should not assign these PCs a different default gateway than the one used by the other systems.
*I assume there isn't a working router at the IP address of the second gateway you're assigning these clients.