Windows 7 Limpeza antes do backup do Clonezilla

5

Atualizei uma caixa do Win7 com o SP1 e atualizei o navegador para o IE11. Eu gostaria de excluir todos os arquivos que não são necessários para operações (por exemplo, instalar arquivos, etc.) para evitar arquivá-los desnecessariamente com o Clonezilla. Existe um bom script, lista ou procedimento que suporte esse objetivo? Obrigado

    
por gatorback 10.03.2017 / 15:05

1 resposta

7

Script e processos de limpeza do Windows 7

Abaixo, há um script em lote que usei no passado para limpar as máquinas Windows 7 e Windows Vista antes da criação de imagens, se você quiser.

Consulte sysprep e considere usá-lo também e executá-lo e quando a máquina é desligada, você vai querer tirar uma imagem com o CloneZilla antes de inicializar novamente no Windows .

Script em lote

Não deixe de ler o script e comentar qualquer coisa que você não queira incluir no processo e testar isso em uma máquina de teste antes, só para garantir que nada de necessário seja limpo ou removido. necessidade.

Este é um script em lote, portanto salve-o em um documento de texto com a extensão de arquivo .cmd ou .bat e certifique-se de clicar com o botão direito do mouse para executar também como administrador.

Eu sei que alguns desses processos também são redundantes, mas eu simplesmente não tive a chance de limpar esses processos duplicados, mas não vai doer para executar um processo de exclusão ou limpeza na mesma pasta, etc. duas vezes de qualquer maneira.

@ECHO on

TASKKILL /F /IM explorer.exe

ECHO *****""Stopping Windows Services""****
NET STOP /Y "Themes"
NET STOP /Y "Windows Update"
NET STOP /Y "Fax"
NET STOP /Y "Print Spooler"
NET STOP /Y "Remote Registry"
NET STOP /Y "Background Intelligent Transfer Service"
NET STOP /Y "Office Source Engine"
NET STOP /Y "Offline Files"
NET STOP /Y "Secondary Logon"
NET STOP /Y "Java Quick Starter"
NET STOP /Y "IIS Admin"
NET STOP /Y "smart card"
NET STOP /Y "Tablet PC Input Service"
NET STOP /Y "Telephony"
NET STOP /Y "Windows Media Player Network Sharing Service"
NET STOP /Y "Windows Mobile 2003-based device connectivity"
NET STOP /Y "Windows Mobile-based device connectivity"
NET STOP /Y "Cisco Systems, Inc. VPN Service"
NET STOP /Y "Adobe LM Service"
NET STOP /Y "Adobe Flash Player Update Service"
NET STOP /Y "Bluetooth Support Service"

SC CONFIG "Adobe Flash Player Update Service" START= manual
SC CONFIG "Adobe LM Service" START= manual
SC CONFIG "Fax" START= manual
SC CONFIG "Offline Files" START= manual
SC CONFIG "Java Quick Starter" START= manual
SC CONFIG "Tablet PC Input Service" START= manual
SC CONFIG "Windows Media Player Network Sharing Service" START= manual
SC CONFIG "Windows Mobile 2003-based device connectivity" START= manual
SC CONFIG "Windows Mobile-based device connectivity"" START= manual

::Setting Source Directories as Variables
SET SRC1=C:\Users
SET SRC2=AppData\Local\Temp
SET SRC3=AppData\Local\Microsoft\Windows\Temporary Internet Files
SET SRC4=AppData\Local\Microsoft\Windows\History
SET SRC5=AppData\Microsoft\Windows\Cookies
SET SRC6=AppData\Local\Microsoft\Windows\WER
SET SRC7=AppData\Local\Microsoft\Windows\Explorer
SET SRC8=AppData\Local

ECHO ****Deleting User\AppData\Local\Temp Sub-Directories****
FOR /D %%X IN ("%SRC1%\*") DO FOR /D %%Y IN ("%%X\%SRC2%\*.*") DO DEL /F /S /Q "%%Y"
FOR /D %%X IN ("%SRC1%\*") DO FOR /D %%Y IN ("%%X\%SRC2%\") DO RMDIR /S /Q "%%Y"

ECHO ***Deleting User\AppData\Local\MS\Windows\Temporary Internet Files***
FOR /D %%X IN ("%SRC1%\*") DO FOR /D %%Y IN ("%%X\%SRC3%\*.*") DO DEL /F /S /Q "%%Y"

ECHO ***Deleting User\AppDate\Local\MS\Windiws\History Sub-Directories***
FOR /D %%X IN ("%SRC1%\*") DO FOR %%Y IN ("%%X\%SRC4%\*.*") DO DEL /F /S /Q "%%Y"
FOR /D %%X IN ("%SRC1%\*") DO FOR /D %%Y IN ("%%X\%SRC4%\") DO RMDIR /S /Q "%%Y"
FOR /D %%X IN ("%SRC1%\*") DO FOR %%Y IN ("%%X\%SRC3%\*.*") DO DEL /F /S /Q "%%Y"

ECHO **Deleting User\AppData\Local\Microsoft\Windows\Cookies Sub-Directories**
FOR /D %%X IN ("%SRC1%\*") DO FOR %%Y IN ("%%X\%SRC5%\*.*") DO DEL /F /S /Q "%%Y"

ECHO **Deleting User\AppData\Local\Microsoft\Windows\WER\ReportArchive & Report Queue**
FOR /D %%X IN ("%SRC1%\*") DO FOR %%Y IN ("%%X\%SRC6%\*.*") DO DEL /F /S /Q "%%Y"

ECHO **Deleting User\AppData\Local\Microsoft\Windows\Explorer**
FOR /D %%X IN ("%SRC1%\*") DO FOR %%Y IN ("%%X\%SRC7%\*.*") DO DEL /F /S /Q "%%Y"


ECHO ****""Deleting Non-User Temp files and directories""****
RMDIR /S /Q C:\WINDOWS\SoftwareDistribution
DEL /F /S /Q %TEMP%\*.*
DEL /F /S /Q %systemroot%\temp\*.*
DEL /F /S /Q C:\ProgramData\TEMP\*.*
DEL /F /S /Q C:\Windows\Temp\*.*
DEL /F /S /Q %windir%\Temp\*.*
FOR /D %%X IN ("%windir%\temp\*") DO RMDIR /S /Q "%%X"

ECHO **Recreate all %userprofile%\Appdata\Local\Temp\Low directory**
FOR /D %%X IN (%SRC1%\*) DO FOR /D %%Y IN (%%X\%SRC8%) DO MD %%Y\Temp\Low

ECHO **Set security level back up on all %userprofile%\Appdata\Local\Temp\Low directory**          
FOR /D %%X IN (%SRC1%\*) DO FOR /D %%Y IN (%%X\%SRC8%) DO ICACLS %%Y\Temp\Low /setintegritylevel (OI)(CI)low

ECHO ** Remove all print jobs that are pendning**
DEL /Q /F "%systemroot%\system32\spool\printers\*.shd"
DEL /Q /F "%systemroot%\system32\spool\printers\*.spl"

::Empty all recycle bins
RD /S /Q C:\recycler
RD /S /Q C:\$RECYCLE.BIN

ECHO *** Turn off Windows hibernation power save setting ***
POWERCFG HIBERNATE OFF

ECHO *** Resize VSS (shadow storage) ***
VSSADMIN RESIZE SHADOWSTORAGE /FOR=C: /ON=C: /MAXSIZE=1GB

ECHO *** Set disk cleanup parameters to clean and then clean after being set ***
CLEANMGR /D c: /SAGESET:100
PAUSE
CLEANMGR /SAGERUN:100

ECHO *** Flush DNS ***
IPCONFIG /FLUSHDNS

ECHO *** Reset TCP/IP ***
NETSH INT IP RESET

ECHO *** Reset Winsock ***
NETSH WINSOCK RESET CATALOG

explorer.exe

GOTO EOF

Comandos Dism

Observação: Se você receber um erro 1260, isso provavelmente significa que você tem a Restauração do sistema desativada na Diretiva de Grupo ou algo assim. Portanto, apenas habilite a Restauração do Sistema e execute novamente esses comandos a partir de um prompt de comando com privilégios de administrador. Além disso, você pode precisar executar CD /D "C:\Windows\System32" antes de executar cada um dos comandos abaixo.

The following command will uninstall all previous versions of components without the scheduled task’s 30-day grace period:

DISM.exe /online /Cleanup-Image /StartComponentCleanup

The following command will remove files needed for uninstallation of service packs. You won’t be able to uninstall any currently installed service packs after running this command:

DISM.exe /online /Cleanup-Image /SPSuperseded

The following command will remove all old versions of every component. You won’t be able to uninstall any currently installed service packs or updates after this completes:

DISM.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase\

source

Mais recursos

por 10.03.2017 / 16:31

Tags