Skip to content

Commit

Permalink
fix(printing): make fax and scan optional
Browse files Browse the repository at this point in the history
  • Loading branch information
he3als committed Jun 13, 2024
1 parent 3429101 commit cd8cbb3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@ call "%windir%\AtlasModules\Scripts\setSvc.cmd" PrintWorkFlowUserSvc 4

call "%windir%\AtlasModules\Scripts\settingsPages.cmd" /hide printers

echo Disabling capabilities...
for %%a in (
"Print.Fax.Scan~~~~0.0.1.0"
"Print.Management.Console~~~~0.0.1.0"
) do (
dism /Online /Remove-Capability /CapabilityName:"%%a" /NoRestart > nul
)

echo Disabling features...
for %%a in (
"Printing-Foundation-Features"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@ call setSvc.cmd PrintWorkFlowUserSvc 3

call "%windir%\AtlasModules\Scripts\settingsPages.cmd" /unhide printers

echo Enabling capabilities (this might take a while)...
for %%a in (
"Print.Fax.Scan~~~~0.0.1.0"
"Print.Management.Console~~~~0.0.1.0"
) do (
dism /Online /Add-Capability /CapabilityName:"%%a" /NoRestart > nul
)

echo Enabling features...
for %%a in (
"Printing-Foundation-Features"
Expand All @@ -77,8 +69,14 @@ for %%a in (
dism /Online /Enable-Feature /FeatureName:"%%a" /NoRestart > nul
)

echo Enabling capabilities (this might take a while)...
dism /Online /Add-Capability /CapabilityName:"Print.Management.Console~~~~0.0.1.0" /NoRestart > nul

if "%~1"=="/silent" exit /b

choice /c:yn /n /m "Would you want to enable Fax and Scan functionality? [Y/N] "
if "%errorlevel%"=="1" dism /Online /Add-Capability /CapabilityName:"Print.Fax.Scan~~~~0.0.1.0" /NoRestart > nul

echo]
echo Finished, please reboot your device for changes to apply.
pause
Expand Down

3 comments on commit cd8cbb3

@sammilucia
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i just used this to fix a Canon multifunction issue. the Canon multifunction driver install fails (of course), but then also can't be removed due to missing fax service.

a possible workaround is to use Canon XPS drivers instead if one doesn't want the fax service installed (i'm not sure this contains the scanner drivers though)

@sammilucia
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

additionally, it appears dism /Online /Remove-Capability /CapabilityName:Print.Management.Console~~~~0.0.1.0 must be run before re-adding it with dism /Online /Add-Capability /CapabilityName:Print.Management.Console~~~~0.0.1.0 to ensure it reinstalls correctly. possibly the same is true for Print.Fax.Scan

@he3als
Copy link
Contributor Author

@he3als he3als commented on cd8cbb3 Jul 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Can't reproduce personally, although I'm testing on 24H2 so it might be different?

Please sign in to comment.