From e61453957db9365cceae38915eb15a9205a30da8 Mon Sep 17 00:00:00 2001 From: Gabe Date: Mon, 23 Nov 2026 23:20:13 +0000 Subject: [PATCH] Add Fix Scripts/Fix - Remove printer driver.ps1 --- Fix Scripts/Fix - Remove printer driver.ps1 | 35 +++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Fix Scripts/Fix - Remove printer driver.ps1 diff --git a/Fix Scripts/Fix - Remove printer driver.ps1 b/Fix Scripts/Fix - Remove printer driver.ps1 new file mode 100644 index 0000000..61bfb05 --- /dev/null +++ b/Fix Scripts/Fix - Remove printer driver.ps1 @@ -0,0 +1,35 @@ +#File path of the driver +$FileName = "C:\Windows\System32\DriverStore\FileRepository\hpcu250u.inf_amd64_82bdf715913ee606" +$FileName2 = "C:\Windows\System32\DriverStore\FileRepository\hpcu255u.inf_amd64_883dd40f467c5d42" + +#Check if the file exists +$testpath = Test-Path $FileName +$testpath2 = Test-Path $FileName2 + +#If definition file exists, delete it +if ($testpath -eq "True") { + #$Ar = New-Object System.Security.AccessControl.FileSystemAccessRule("ANB\UFS-ITS","FullControl","ObjectInherit,ContainerInherit","None","Allow") + #$Acl.SetAccessRule($Ar) + ##$acl.SetOwner([System.Security.Principal.NTAccount]"ANB\UFS-ITS") + #Set-Acl -Path $FileName -AclObject $Acl + Remove-Item $FileName -Force -Recurse + write-host "$FileName has been deleted" +} +#If definition file doesnt exist, dont do anything +else { + Write-host "$FileName doesn't exist" +} + +#If definition file exists, delete it +if ($testpath2 -eq "True") { + #$Ar = New-Object System.Security.AccessControl.FileSystemAccessRule("ANB\UFS-ITS","FullControl","ObjectInherit,ContainerInherit","None","Allow") + #$Acl.SetAccessRule($Ar) + ##$acl.SetOwner([System.Security.Principal.NTAccount]"ANB\UFS-ITS") + #Set-Acl -Path $FileName -AclObject $Acl + Remove-Item $FileName2 -Force -Recurse + write-host "$FileName2 has been deleted" +} +#If definition file doesnt exist, dont do anything +else { + Write-host "$FileName2 doesn't exist" +} \ No newline at end of file