Hi Bhargavpp,
You can do this by modifying the registry via C# code.
using Microsoft.Win32;
RegistryKey key;
key = Registry.LocalMachine.OpenSubKey
("SYSTEM\\CurrentControlSet\\Services\\UsbStor");
key.SetValue("Start", 4, RegistryValueKind.DWord);
key.SetValue("Start", 3, RegistryValueKind.DWord);
Any devices already connected will remain there, but no new usb drives plugged in will be automatically mounted.
Happy Coding..!
Thank you,
Vamsi