|
10.txt 모든 내용 영문으로 보기 ㅎ
https://cafe.daum.net/candan/GGFN/459 파워쉘로 기본적인 제거 방법
'Microsoft enhanced Point and Print compatibility driver' remove
공유 관련 같은대 난 필요가 없어서 삭제 했다 ㅎㅎ 휴.. 한대 문제는 다시 생성 된다 -_-;; 그게 문제 같음 ㅠㅠ 무의미
REM 기존 것이다 sc stop "Spooler" & sc config "Spooler" start= disabled
sc config "Spooler" start= demand
먼지 프린터를 수동으로 해야 한다
sc start "Spooler"
시작 해야 한다.
printui /s /t2
명령어로 확인 한다.
sc stop "Spooler"
다시 중지 하고.. 아래 처럼 하면 된다. 그리고 다시 스타트 하고 켜보면 사라져 있다.
https://cafe.daum.net/candan/I45j/80 레지스트 찾기
수정 전에 백업 하기
REG EXPORT "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environments" d:\Print_Environments.reg
REM Environments 프린터 경로에서 모든 enhanced 드라이를 찾으시오"
REG QUERY "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environments" /k /f "Microsoft enhanced Point and Print compatibility driver" /s > %temp%\test.txt
REM "입력한 test.txt에서 원하는 내용만 추출 하여 777.txt로 보내세요"
findstr /C:"Microsoft enhanced Point and Print compatibility driver" %temp%\test.txt > %temp%\777.txt
REM "해당 경로만 삭제 하시오"
for /f "delims=" %i in ('type %temp%\777.txt') do set "aa=%i" & cmd /V:ON /C "REG delete "!aa!" /f"
위에 것은 Microsoft enhanced Point and Print compatibility driver 하나만 삭제 한다면 아래 것은 여러개 삭제 할때.
REM "Environments 프린터 경로에서 모든 enhanced 드라이를 찾으시오"
REG QUERY "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environments" /k /f "Microsoft enhanced Point and Print compatibility driver" /s > %temp%\test.txt
REM "Microsoft Shared Fax Driver 찾기 > 표시는 추가 하라는 말이다 삭제 말고"
REG QUERY "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environments" /k /f "Microsoft Shared Fax Driver" /s >> %temp%\test.txt
REG QUERY "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environments" /k /f "Microsoft Print To PDF" /s >> %temp%\test.txt
REG QUERY "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environments" /k /f "Microsoft Software Printer Driver" /s >> %temp%\test.txt
REG QUERY "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environments" /k /f "Microsoft XPS Document Writer v4" /s >> %temp%\test.txt
REM "입력한 test.txt에서 원하는 내용만 추출 하여 777.txt로 보내세요"
findstr /C:"Microsoft enhanced Point and Print compatibility driver" %temp%\test.txt > %temp%\777.txt
REM "Microsoft Shared Fax Driver 문장 찾기"
findstr /C:"Microsoft Shared Fax Driver" %temp%\test.txt >> %temp%\777.txt
findstr /C:"Microsoft Print To PDF" %temp%\test.txt >> %temp%\777.txt
findstr /C:"Microsoft Software Printer Driver" %temp%\test.txt >> %temp%\777.txt
findstr /C:"Microsoft XPS Document Writer v4" %temp%\test.txt >> %temp%\777.txt
REM "해당 경로만 삭제 하시오"
for /f "delims=" %i in ('type %temp%\777.txt') do set "aa=%i" & cmd /V:ON /C "REG delete "!aa!" /f"
REM "제거 목표들"
Microsoft enhanced Point and Print compatibility driver
Microsoft Shared Fax Driver
Microsoft Print To PDF
Microsoft Software Printer Driver
Microsoft XPS Document Writer v4
TAKEOWN /f "%windir%\System32\spool\drivers\x64\*" /r /d y
icacls "%windir%\System32\spool\drivers\x64\*" /reset /T
icacls "%windir%\System32\spool\drivers\x64\*" /grant Administrator:F
TAKEOWN /f "%windir%\System32\spool\drivers\W32X86\*" /r /d y
icacls "%windir%\System32\spool\drivers\W32X86\*" /reset /T
icacls "%windir%\System32\spool\drivers\W32X86\*" /grant Administrator:F
삭제가 안되게 권한 까지 이상하게 가지고 있다 ㅋㅋ;; 삭제 해주기.
for /d %i in ("C:\Windows\System32\spool\drivers\x64\*") do if exist "%i\[0-9][0-9]?" rmdir "%i" /s /q
하지만 이것의 단점은.. 문자열이 있는 폴더가 같이 있으면 작동을 안함 ㅠ..
그래서
한계라고 한다
C:\Windows\System32\spool\drivers\x64\3 이 있는 경우
Remove-Item -Path "C:\Windows\System32\spool\drivers\x64\[0-99]*" -Recurse -Force
이렇게 하면 성공함 ㅎㅎ;; ㅎㅎ 올래
Remove-Item -Path "$env:SystemRoot\System32\spool\drivers\x64\[0-99]*" -Recurse -Force
Remove-Item -Path "$env:SystemRoot\System32\spool\drivers\W32X86\[0-99]*" -Recurse -Force
# 경로 https://cafe.daum.net/candan/ASdB/410
Remove-Item -Path "$env:SystemRoot\System32\spool\drivers\x64\PCC" -Recurse -Force
Remove-Item -Path "$env:SystemRoot\System32\spool\drivers\W32X86\PCC" -Recurse -Force
Remove-Item -Path "$env:SystemRoot\System32\spool\drivers\W32X86\*" -Recurse -Force
Remove-Item -Path "C:\Windows\System32\spool\drivers\x64\*\[0-9]*" -Recurse -Force
Remove-Item -Path "C:\Windows\System32\spool\drivers\x64\3" -Recurse -Force
나머지 AI가 알려준것 작동을 잘안한다. 첫번째 것은
"gpedit.msc"를 입력하고 "확인(OK)"을 클릭합니다.
"컴퓨터 구성(Computer Configuration)" > "정책(Policies)" > "관리 템플릿(Templates)" > "시스템(System)"을 차례로 클릭합니다.
"자동으로 장치 드라이버 설치 하지 않음(Prevent installation of devices not described by other policy settings)"를 두 번 클릭합니다.
"활성화(Enabled)"를 선택하고, "적용(Apply)"을 클릭한 후 "확인(OK)"을 클릭합니다.
REM "메타 드라이브 다운로드 금지 https://admx.help/?Category=Windows_10_2016&Policy=Microsoft.Policies.DeviceSoftwareSetup::DeviceMetadata_PreventDeviceMetadataFromNetwork "
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceInstall\Settings" /v "PreventDeviceMetadataFromNetwork" /t REG_DWORD /d "1" /f
REM "첫 번째 명령어와 유사하지만, "PreventDeviceMetadataAndThirdPartyDriverDownload" 값을 생성하여 "타사 드라이버 다운로드 방지" 정책을 설정합니다."
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceInstall\Settings" /v "PreventDeviceMetadataAndThirdPartyDriverDownload" /t REG_DWORD /d "1" /f
프린터 접근 제한하기
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Spooler" /v EveryoneIncludesAnonymous /t REG_DWORD /d 0 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Spooler" /v GuestAccess /t REG_DWORD /d 0 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Spooler" /v GuestsAccess /t REG_DWORD /d 0 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Spooler" /v IIS_IUSRSAccess /t REG_DWORD /d 0 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Spooler" /v RemoteInteractiveLogonAccess /t REG_DWORD /d 0 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Spooler" /v RemoteManagementUsersAccess /t REG_DWORD /d 0 /f
powershell.exe -Command "& {Get-ChildItem $env:SystemRoot\System32\spool\V4Dirs | Remove-Item -recurse}"
C:\Windows\System32\spool\V4Dirs
폴더에는 프린터 설정이 저장 된다고 하는대 제거 함 ㅎㅎ;;
완성품 보안 강화 하기.. 작동 안할수 있음 보안 강화하면 작동을 못한다 ㅠ reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Spooler" /v RequiredPrivileges /t REG_MULTI_SZ /d "SeTcbPrivilege\0SeImpersonatePrivilege\0SeAuditPrivilege\0SeChangeNotifyPrivilege\0SeAssignPrimaryTokenPrivilege\0SeLoadDriverPrivilege\0SeDenyBatchLogonRight\0SeDenyInteractiveLogonRight\0SeDenyNetworkLogonRight\0SeDenyRemoteInteractiveLogonRight\0SeDenyServiceLogonRight\0" /f
오리지널
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Spooler" /v RequiredPrivileges /t REG_MULTI_SZ /d "SeTcbPrivilege\0SeImpersonatePrivilege\0SeAuditPrivilege\0SeChangeNotifyPrivilege\0SeAssignPrimaryTokenPrivilege\0SeLoadDriverPrivilege\0" /f
https://cafe.daum.net/candan/GGFN/463 수상한 소유권 다시 정리하기
https://www.itdroplets.com/set-permissions-for-a-print-server-with-powershell/ 서버의 경우 이렇게 하면 되는 것 같다
https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/rundll32-printui printui 기본명령어
드디어 성공.. ㅎㅎ 한대 웃긴건 덕분이 이상한걸 배웠다 ㅋ https://cafe.daum.net/candan/GGFN/464
pnputil /enum-devices /drivers > d:\install_drivers.txt
pnputil /disable-device "SWD\PRINTENUM\{11B3BA36-1C3A-4163-9DB3-F5D23E0F71E8}"
REM "XPS"
pnputil /remove-device "SWD\PRINTENUM\{11B3BA36-1C3A-4163-9DB3-F5D23E0F71E8}"
REM "Microsoft Print to PDF"
pnputil /remove-device "SWD\PRINTENUM\{403EA90E-6BDA-4EB4-9BB4-BC40E5920519}"
|
첫댓글 wmic printer where "default='TRUE'" delete
(Get-Printer).where({$_.IsDefaultPrinter}).Delete()
Get-Printer | where {$_.IsDefault} | foreach {$_.Delete()}
https://learn.microsoft.com/ko-kr/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.3
높은 파워쉘을 설치 해야 한다고 ㅠ
https://admx.help/?Category=Windows_10_2016&Policy=Microsoft.Policies.DeviceSoftwareSetup::DeviceMetadata_PreventDeviceMetadataFromNetwork
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceInstall\Settings" /v "PreventDeviceMetadataFromNetwork" /t REG_DWORD /d "1" /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceInstall\Settings" /v "PreventDeviceMetadataAndThirdPartyDriverDo
새로운 장치 설치 방지
https://www.tenforums.com/drivers-hardware/203615-my-journey-removing-my-default-windows-printer.html#post2524534
https://www.tenforums.com/tutorials/101201-remove-printer-windows-10-a.html