Código para excluir arquivos durante a inicialização

0

Estou desenvolvendo um antivírus. Eu quero saber como faço para agendar para excluir um arquivo malicioso durante a inicialização do sistema (durante a tela preta em si), se eu já detectei o arquivo infectado. Algo como mostrado na imagem.

  1. Easeus agendou o particionamento de disco durante a inicialização: link
  2. Outra exclusão de arquivo agendado durante a inicialização: link
por Technolust 17.08.2014 / 08:42

1 resposta

1

Se você quiser usar um utilitário, o Sysinternals tem um (dois, na verdade): PendMoves v1.2 e MoveFile v1.01

A partir da descrição:

There are several applications, such as service packs and hotfixes, that must replace a file that's in use and is unable to. Windows therefore provides the MoveFileEx API to rename or delete a file and allows the caller to specify that they want the operation to take place the next time the system boots, before the files are referenced. Session Manager performs this task by reading the registered rename and delete commands from the HKLM\System\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations value.

Se você deseja incluir essa função da API em seu código, aqui está uma especificação da Microsoft: Função MoveFileEx

    
por 17.08.2014 / 11:34