EMP...
Yeah.
But an EMP weapon doesn’t discriminate between friendly or enemy electronics (or military vs civilian electronics, for that matter). So unless you’ve got some way to issue a warning AND protect the electronics, you will do as much damage to yourself as the enemy.
Here’s a scary thought. What if you had a directional EMP weapon that only did one thing: set off the primers in small arms ammunition? Range would be dependent on weapon size and power supply.
Hmmm...