Skip to content

Instantly share code, notes, and snippets.

@sgeraldes
Last active November 21, 2024 05:07
Show Gist options
  • Save sgeraldes/97a9a2832629828865393e9437ed567a to your computer and use it in GitHub Desktop.
Save sgeraldes/97a9a2832629828865393e9437ed567a to your computer and use it in GitHub Desktop.
Disable Nahinic Service

Nahimic Uninstallation Script

This PowerShell script allows you to uninstall Nahimic completely from your system, removing all traces of the software and related components.

Prerequisites

  • Windows operating system
  • Administrative privileges
  • PowerShell

Manual Installation

  1. Download the uninstall-nahimic.ps1 script to your computer.

Usage

  1. Open a PowerShell console with administrative privileges.

  2. Navigate to the directory where the script is located.

  3. Run the script by executing the following command: ''.\uninstall-nahimic.ps1

  4. Follow the prompts and wait for the script to complete the uninstallation process. The computer will automatically restart at the end.

Manual Disabling of Nahimic

If you prefer to manually disable Nahimic without using the script, follow these steps:

  1. Press Windows + R to open the Run dialog, type "services.msc," and press Enter.

  2. In the Services window, locate the "Nahimic service" and right-click on it. Select "Properties."

  3. In the Nahimic Service Properties window, select "Disabled" in the "Startup type" section. Click Apply and then OK.

  4. Additionally, you can open Task Manager (Ctrl + Shift + Esc), locate any processes related to A-Volute NS or MSI, and end them.

  5. Remember to restart your computer for the changes to take effect.

Disclaimer

  • Use this script at your own risk. Ensure you have a backup or restore point before making any changes to your system.

  • Review the script and understand its functionality before executing it.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvement, please open an issue or submit a pull request on GitHub.

License

This script is licensed under the MIT License.

# Check Nahimic service status
$nahimicService = Get-Service -Name "Nahimic service" -ErrorAction SilentlyContinue
if ($nahimicService) {
if ($nahimicService.Status -eq "Running") {
Write-Host "Nahimic service is currently running." -ForegroundColor Yellow
Write-Host "Advice: If you're experiencing issues related to Nahimic or high CPU/RAM usage, consider stopping and disabling the service."
}
else {
Write-Host "Nahimic service is present but currently not running." -ForegroundColor Green
Write-Host "Advice: If you're not using Nahimic or facing any issues, it's recommended to keep the service disabled."
}
}
else {
Write-Host "Nahimic service is not installed or not found." -ForegroundColor Green
Write-Host "Advice: If you're not using Nahimic or facing any issues, there's no need to install or enable the service."
}
# Check Nahimic mirroring device
$nahimicMirroringDevice = Get-PnpDevice | Where-Object { $_.Class -eq "Media" -and $_.FriendlyName -like "*Nahimic mirroring*" }
if ($nahimicMirroringDevice) {
Write-Host "Nahimic mirroring device is present." -ForegroundColor Yellow
Write-Host "Advice: If you're not using Nahimic or facing any issues, consider disabling or uninstalling the Nahimic mirroring device."
}
else {
Write-Host "Nahimic mirroring device is not found." -ForegroundColor Green
Write-Host "Advice: If you're not using Nahimic or facing any issues, there's no need to disable or uninstall the mirroring device."
}
# Check Nahimic-related registry keys
$nahimicRegistryKeys = @(
"HKLM:\SYSTEM\CurrentControlSet\Services\NahimicService",
"HKLM:\SYSTEM\CurrentControlSet\Services\Nahimic_Mirroring",
"HKCU:\SOFTWARE\A-Volute"
)
$missingRegistryKeys = $nahimicRegistryKeys | Where-Object { -not (Test-Path -Path $_) }
if ($missingRegistryKeys) {
Write-Host "Some Nahimic-related registry keys are missing." -ForegroundColor Green
Write-Host "Advice: If you're not using Nahimic or facing any issues, there's no need to add or modify the registry keys."
}
else {
Write-Host "All Nahimic-related registry keys are present." -ForegroundColor Yellow
Write-Host "Advice: If you're not using Nahimic or facing any issues, consider removing or modifying the registry keys."
}
# Check Nahimic-related files and folders
$nahimicFolders = "C:\Windows\System32\A-Volute", "C:\Program Files (x86)\MSI\One Dragon Center\Nahimic"
$nahimicFiles = "C:\Windows\System32\NahimicService.exe", "$env:APPDATA\Local\NhNotifSys"
$missingFolders = $nahimicFolders | Where-Object { -not (Test-Path -Path $_) }
$missingFiles = $nahimicFiles | Where-Object { -not (Test-Path -Path $_) }
if ($missingFolders -or $missingFiles) {
Write-Host "Some Nahimic-related files or folders are missing." -ForegroundColor Green
Write-Host "Advice: If you're not using Nahimic or facing any issues, there's no need to have these files or folders present on your system."
if ($missingFolders) {
Write-Host "Missing folders:" -ForegroundColor Yellow
$missingFolders | ForEach-Object {
Write-Host " $_"
}
}
if ($missingFiles) {
Write-Host "Missing files:" -ForegroundColor Yellow
$missingFiles | ForEach-Object {
Write-Host " $_"
}
}
}
else {
Write-Host "All Nahimic-related files and folders are present." -ForegroundColor Yellow
Write-Host "Advice: If you're not using Nahimic or facing any issues, consider removing or modifying these files and folders."
}
# Check Nahimic-related tasks in Task Scheduler
$nahimicTasks = Get-ScheduledTask | Where-Object { $_.TaskPath -match "Nahimic|A-Volute" }
if ($nahimicTasks) {
Write-Host "Nahimic-related tasks are present in Task Scheduler." -ForegroundColor Yellow
Write-Host "Advice: If you're not using Nahimic or facing any issues, consider disabling or removing these tasks."
}
else {
Write-Host "No Nahimic-related tasks found in Task Scheduler." -ForegroundColor Green
Write-Host "Advice: If you're not using Nahimic or facing any issues, there's no need to modify Task Scheduler."
}
# Check Nahimic Store App installation
$nahimicStoreApp = Get-AppxPackage -Name "*nahimic*" -ErrorAction SilentlyContinue
if ($nahimicStoreApp) {
Write-Host "Nahimic Store App is installed." -ForegroundColor Yellow
Write-Host "Advice: If you're not using Nahimic or facing any issues, consider uninstalling the Nahimic Store App."
}
else {
Write-Host "Nahimic Store App is not installed." -ForegroundColor Green
Write-Host "Advice: If you're not using Nahimic or facing any issues, there's no need to uninstall the Nahimic Store App."
}
# Check Nahimic-related device ID blacklist
$denyDeviceIDsKey = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DeviceInstall\Restrictions\DenyDeviceIDs"
$deviceIDBlacklist = @(
"ROOT\Nahimic_Mirroring",
"SWC\VEN_AVOL&AID_0300",
"SWC\VEN_AVOL&AID_0400"
)
$blacklistedIDs = $deviceIDBlacklist | Where-Object {(Get-ItemProperty -Path $denyDeviceIDsKey -Name $_ -ErrorAction SilentlyContinue) -ne $null}
if ($blacklistedIDs) {
Write-Host "Nahimic-related device IDs are blacklisted." -ForegroundColor Yellow
Write-Host "Advice: If you want to prevent further installations of Nahimic-related devices, you can add additional device IDs to the blacklist in the registry."
}
else {
Write-Host "Nahimic-related device IDs are not blacklisted." -ForegroundColor Green
Write-Host "Advice: If you're not experiencing issues or don't want to restrict device installations, there's no need to modify the device ID blacklist."
}
Windows Registry Editor Version 5.00
;Description: Disable Nahimic Service and Device IDs
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceInstall\Restrictions]
"DenyDeviceIDs"=dword:00000001
"DenyDeviceIDsRetroactive"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceInstall\Restrictions\DenyDeviceIDs]
"1"="ROOT\\Nahimic_Mirroring"
"2"="SWC\\VEN_AVOL&AID_0300"
"3"="SWC\\VEN_AVOL&AID_0400"
# Check if Chocolatey is installed
if (!(Get-Command choco -ErrorAction SilentlyContinue)) {
Write-Host "Chocolatey is not installed. Please install Chocolatey (https://chocolatey.org/install) and run the script again." -ForegroundColor Red
exit
}
# Install Driver Store Explorer (RapR) using Chocolatey
choco install rapr -y
# Stop and disable Nahimic service
Stop-Service -Name "Nahimic service"
Set-Service -Name "Nahimic service" -StartupType Disabled
# End processes related to A-Volute NS and MSI
Get-Process -Name "A-Volute NS", "MSI*" | Stop-Process -Force
# Delete Nahimic-related registry keys
Remove-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Services\NahimicService" -ErrorAction SilentlyContinue
Remove-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Nahimic_Mirroring" -ErrorAction SilentlyContinue
Remove-Item -Path "HKCU:\SOFTWARE\A-Volute" -ErrorAction SilentlyContinue
# Uninstall Nahimic mirroring device
$nahimicMirroringDevice = Get-PnpDevice | Where-Object {$_.Class -eq "Media" -and $_.FriendlyName -like "*Nahimic mirroring*"}
if ($nahimicMirroringDevice) {
$nahimicMirroringDevice | Disable-PnpDevice -Confirm:$false -ErrorAction SilentlyContinue
}
# Remove Nahimic-related drivers using Driver Store Explorer
$driverStoreExplorerPath = "C:\Path\To\DriverStoreExplorer\Rapport\RAPR.exe"
$driverList = & $driverStoreExplorerPath -Get-Drivers | Where-Object {$_.Provider -match "A-Volute|Nahimic"}
$driverList | ForEach-Object {
& $driverStoreExplorerPath -Delete-Driver -DriverPackageFullName $_.DriverPackageFullName -ForceDeletion
}
# Delete Nahimic-related files and folders
$nahimicFolders = "C:\Windows\System32\A-Volute", "C:\Program Files (x86)\MSI\One Dragon Center\Nahimic"
$nahimicFiles = "C:\Windows\System32\NahimicService.exe", "$env:APPDATA\Local\NhNotifSys"
Remove-Item -Path $nahimicFolders, $nahimicFiles -Force -Recurse -ErrorAction SilentlyContinue
# Remove Nahimic-related tasks from Task Scheduler
$nahimicTasks = Get-ScheduledTask | Where-Object {$_.TaskPath -match "Nahimic|A-Volute"}
$nahimicTasks | Unregister-ScheduledTask -Confirm:$false
# Restart the computer
Restart-Computer -Force
@Squall-Leonhart
Copy link

Squall-Leonhart commented Nov 15, 2024

You might want to incorporate some usage of the trusted-installer account into the removal because on recent msi updates it is now protected from administrator group removal.

https://github.com/jschicht/RunAsTI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment