윈 도 우 배치 파일을 이용해서 폴더 일괄삭제 하려고 하는데요?
2015.12.20 21:49
제가 윈도우10에서 Windows Powershell를 관리자 권한으로 실행해서 하나하나 비활성화 하고
win10 PE로 부팅 해서 기본앱이 깔린 폴더를 일괄로 싹 지우려고 밑과 같이 만들었는데.. 안지워 지더라구요..
잘 아시는분 수정좀 부탁 드립니다..
예를 *3DBuilder* 를 들어 한거는 앞뒤로 많은 숫자와 영어가 들어가 *로 하면 뒤에 영문과 숫자 무시 하고
3DBuilder만 들어간 폴더 모두 지울수 있게 하려고 한거 입니다..
부탁좀 드립니다.. 폴더 하나하나 지우려니 오래걸려서요..
@echo off
cls
echo.
rd "C:\Program Files\WindowsApps\*3DBuilder*" /Q /S > NUL 2>&1
rd "C:\Program Files\WindowsApps\*BingFinance*" /Q /S > NUL 2>&1
rd "C:\Program Files\WindowsApps\*BingSports*" /Q /S > NUL 2>&1
rd "C:\Program Files\WindowsApps\*CommsPhone*" /Q /S > NUL 2>&1
rd "C:\Program Files\WindowsApps\*MicrosoftOfficeHub*" /Q /S > NUL 2>&1
rd "C:\Program Files\WindowsApps\*Onenote*" /Q /S > NUL 2>&1
rd "C:\Program Files\WindowsApps\*Sway*" /Q /S > NUL 2>&1
rd "C:\Program Files\WindowsApps\*people*" /Q /S > NUL 2>&1
rd "C:\Program Files\WindowsApps\*SkypeApp*" /Q /S > NUL 2>&1
rd "C:\Program Files\WindowsApps\*solitairecollection*" /Q /S > NUL 2>&1
rd "C:\Program Files\WindowsApps\*windowscamera*" /Q /S > NUL 2>&1
rd "C:\Program Files\WindowsApps\*windowsphone*" /Q /S > NUL 2>&1
rd "C:\Program Files\WindowsApps\*xboxapp*" /Q /S > NUL 2>&1
rd "C:\Program Files\WindowsApps\*zunemusic*" /Q /S > NUL 2>&1
rd "C:\Program Files\WindowsApps\*zunevideo*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Applications\*3DBuilder*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Applications*BingFinance*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Applications*BingSports*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Applications*CommsPhone*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Applications*MicrosoftOfficeHub*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Applications*Onenote*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Applications*Sway*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Applications*people*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Applications*SkypeApp*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Applications*solitairecollection*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Applications*windowscamera*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Applications*windowsphone*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Applications*xboxapp*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Applications*zunemusic*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Applications*zunevideo*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Packages\*3DBuilder*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Packages\*BingFinance*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Packages\*BingSports*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Packages\*CommsPhone*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Packages\*MicrosoftOfficeHub*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Packages\*Onenote*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Packages\*Sway*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Packages\*people*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Packages\*SkypeApp*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Packages\*solitairecollection*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Packages\*windowscamera*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Packages\*windowsphone*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Packages\*xboxapp*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Packages\*zunemusic*" /Q /S > NUL 2>&1
rd "C:\Windows\InfusedApps\Packages\*zunevideo*" /Q /S > NUL 2>&1
댓글 [2]
-
suk 2015.12.20 22:06
-
메리아 2015.12.21 09:56
흔한 오해가 있는데,
와일드 카드는 아무데서나 다 먹히지 않는 편입니다.
안되는게 더 많죠.
특히 DIR에서조차 무조건적으로는 안먹힙니다.
(ex. dir c:\aaa*\bbb* 이런식은 안됨. c:\aaabcd\bbb* 이런식으로 상위 경로는 지정해주고 써야함.)
저는 rd명령 잘 안써서 몰랐는데,
지금 rd명령 테스트 해보니 와일드 카드가 안먹히는 명령이군요.
그러므로 저런 명령은 성립자체가 안됩니다.
저런건 dir *핵심폴더명* /ad /b > list.txt 이런식으로 리스트를 만들어서 for문으로 읽어와서 처리하는게 좋습니다.
(/s 옵션이 없으면 경로명 안나오므로 주의. 근데 /s 하면 하위경로까지 나오므로 주의.)
번호 | 제목 | 글쓴이 | 조회 | 등록일 |
---|---|---|---|---|
[공지] | 질문과 답변 게시판 이용간 유의사항 | gooddew | - | - |
31683 | 윈 도 우| 하... 답답해서 장치연결? 문제떄문에 | 윈도우유저 | 872 | 11-16 |
31682 | 모 바 일| v20 음성인식 기능 사용방법 아시는 분 ...ㅠ [1] | StolenRose | 872 | 04-25 |
31681 | 윈 도 우| 재업)긴글) 수정이안되어서 다시올립니다.... 읽어주셔서 ... [18] | 다니짱 | 871 | 06-25 |
31680 | 윈 도 우| IDM 구매 [7] | 수비니 | 871 | 05-20 |
31679 | 모 바 일| 백신 패스 QR코드 어르신용 편한것 없을까요? [30] | 카야 | 871 | 01-12 |
31678 | 기 타| 카조님 비번 [9] | 당구재료 | 871 | 03-12 |
31677 | 윈 도 우| 토렌트에서 성인광고 나오는데 안나타게 할수없나요? [10] | 뭐필요하우 | 871 | 01-30 |
31676 | 기 타| hdmi to 안테나 소켓?? [18] | aqz | 871 | 09-08 |
31675 | 윈 도 우| 확인이 필요한 항목이 나오면서 윈도 업데이트가 안됩니다 [4] | 체리^^ | 871 | 05-25 |
31674 | 윈 도 우| Windows 10 1803 수명이 언제까지 인가요? [1] | 럭키보이 | 871 | 12-08 |
31673 | 서버 / IT| 씨네스트 접속 되나요? [5] | 토니™짱야 | 871 | 06-29 |
31672 | 모 바 일| 문의)) 스마트폰 내장저장소와 외장SD카드 통합하는 법 좀 ... [1] | chobits | 871 | 05-18 |
31671 | 윈 도 우| suk 님 32비트 64비트 겸용 뼈대로 USB 구웠는데 이러는 이... [8] | Rixs | 871 | 01-29 |
31670 | 윈 도 우| 윈도우8.1을 10 으로 업그레이드후 인증이 플립니다, [3] | 좋은데이 | 871 | 10-28 |
31669 | 기 타| 모니터와 티비 질문있습니다. [4] | 바이티 | 871 | 10-18 |
31668 | 소프트웨어| 팟인코더와 무비메이커를 합친 형태의 동영상편집기를 추천... [3] | brucex | 871 | 09-30 |
31667 | 소프트웨어| logitechg_discord가 cpu점유율을 많이먹는데 이건 무슨서... [2] | shy1911 | 871 | 06-23 |
31666 | 윈 도 우| 윈도우 설치 문의 [4] | 카비 | 871 | 09-17 |
31665 | 윈 도 우| 만고 질문입니다 [1] | 슭이남편 | 871 | 12-05 |
31664 | 소프트웨어| 프로그램 인스톨할때 파일이랑 레지스트리 감시하는 유틸이... [2] | 규혀니 | 871 | 11-11 |
https://windowsforum.kr/review/6720788
이걸 참고로 해보세요