Skip to content

Instantly share code, notes, and snippets.

@HamousOnWheels
Last active March 4, 2018 23:10
Show Gist options
  • Select an option

  • Save HamousOnWheels/0fdce05087373904fdd19f7de3b295ed to your computer and use it in GitHub Desktop.

Select an option

Save HamousOnWheels/0fdce05087373904fdd19f7de3b295ed to your computer and use it in GitHub Desktop.
Reset crashed Wacom drivers
# Reset crashed Wacom drivers and restore settings automatically (since they can get lost on stopping the service).
# Tested with driver version 6.3.27-2. Restart your painting app after running the script.
#elevation
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
{
$arguments = "& '" + $myinvocation.mycommand.definition + "'"
Start-Process powershell -Verb runAs -ArgumentList $arguments
Break
}
#backup the settings
& "C:\Program Files\Tablet\Wacom\32\PrefUtil.exe" /backup "$ENV:UserProfile\Documents\WacomBackup.wacomprefs"
$running = Get-Service WTabletServicePro
#restart the service, if it still isn't running keep trying
do
{
"restarting Wacom service..."
Restart-Service "WTabletServicePro"
Write-Host $running.Status
Start-Sleep -Seconds 2
$running.Refresh()
if ($running.Status -eq 'Running') #now we're talkin
{
"restoring settings..."
& "C:\Program Files\Tablet\Wacom\32\PrefUtil.exe" /restore /silent "$ENV:UserProfile\Documents\WacomBackup.wacomprefs"
Wait-Process -Name PrefUtil #wait until prefutil is done. For some reason it's faster with the /silent switch
}
} while ($running.Status -ne 'Running')
Read-Host -Prompt "Done. Press Enter to exit and then restart your painting app"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment