0

I am trying to disable portable device using setupdixxx APIs and device is getting blocked and no device content is visible. I want device to be in disable state and no content should be visible. But its content is getting visible when I try to enable it from device manager.

Here is my pseudo code.

  1. Enumerate portable devices, [Device state: Enable] if it is connected, disable it. [Device state: Disable]
  2. If manual intervention is detected, [Device state: Enable] disable it again. [Device state: Disable][Reboot required to change this state]

The last Disable is not happening properly as system requires a reboot. In this case, its contents are getting visible.

Is there any way to avoid this.. I dont want its contents to be visible.

or Is there any way to restrict user from enabling device from device manager??

Thanks in advance.

Mr_Aj
  • 1
  • 1
  • "Is there any way to restrict user from enabling device from device manager?" Yes. Don't give them Administrator permissions. With those permissions, they can do anything. That includes bypassing your hack. Seriously, stop with these things. You break more than that you fix. Use the proper tools for the job. – MSalters Nov 12 '19 at 11:53
  • Extending what @MSalters says you should be using Domain-Group Policies or give up. Admin rights are God rights on the local box. – Richard Critten Nov 12 '19 at 12:02

0 Answers0