Medium
Operating Systems
✓ Solution Verified by Community (0+ upvotes)
How to fix error error-bad-command in Windows 11
ERROR_BAD_COMMAND = 22
Fix based on community reports and expert analysis. Last verified: 2026-08-12
· How we verify fixes
| Error Code | error-bad-command |
|---|---|
| Affected System | Windows 11 (Microsoft) |
| Difficulty | Medium |
| Estimated Time | 30 min |
| Requires Admin Rights | ⚠️ Yes |
| Requires Reboot | 🔄 Yes |
Solution Steps
- 1 Restart your computer. Press Windows key, click the Power icon, and select 'Restart'. This clears temporary glitches and resets hardware connections. Many times, a simple reboot resolves the 'bad command' error.
- 2 Update the driver for the problematic device. Press Windows key + X and select 'Device Manager'. Find the device (e.g., under 'Printers' or 'Disk drives'), right-click it, and select 'Update driver'. Choose 'Search automatically for drivers'. If Windows doesn't find a new one, visit the manufacturer's website and download the latest driver for your specific model and Windows 11.
- 3 Run the Hardware and Devices troubleshooter. Press Windows key + I to open Settings, go to 'System' → 'Troubleshoot' → 'Other troubleshooters'. Click 'Run' next to 'Hardware and Devices'. This tool automatically detects and fixes common hardware issues, including driver problems.
- 4 Check for Windows updates. Press Windows key + I, go to 'Windows Update', and click 'Check for updates'. Install any pending updates and restart. Updates often include fixes for device compatibility issues.
- 5 If the error occurs with a specific program, try reinstalling that program. Uninstall it via Settings → Apps → Installed apps, then download the latest version from the official website and install it. This ensures the program sends commands that your hardware understands.
- 6 For printers, remove and re-add the printer. Go to Settings → Bluetooth & devices → Printers & scanners. Select the printer, click 'Remove device', then click 'Add device' to reinstall it. This resets the printer driver and communication.
🔍 Didn't work? Enter your GPU and CPU for hardware-specific advice:
🔧 Still having issues?
Describe your exact problem to Error Buddy and get a personalized fix in seconds.
🛠️ Try Error Buddy — It's Free