Turn off power from USB

I’m using an enclosure that came with my CNC mill, which has an on off button.
Can I somehow turn off USB power for the board when this button is off?

I have the power regulator so basically I don’t need any power from the USB port

Imported from wikidot

Found the best solution
Just cut off the 5V line on your USB cable