Hello there,
You can check the prevent access policy.
When Prevent access to drives from My Computer is enabled, users can browse the directory structure in File Explorer, but they cannot open folders and access the contents. Also, they cannot use the Run dialog box or the Map Network Drive dialog box to view the directories on these drives. The icons representing the specified drives still appear in File Explorer, but if users double-click the icons, a message appears explaining that a setting prevents the action. This setting does not prevent users from using programs to access local and network drives. It does not prevent users from using the Disk Management snap-in to view and change drive characteristics.
https://learn.microsoft.com/en-us/windows/configuration/kiosk-policies
Hope this resolves your Query !!
--If the reply is helpful, please Upvote and Accept it as an answer--