PoshInternals – Move-FileOnReboot, Remove-FileOnReboot and Get-PendingFileRenameOperation

Other posts found in this series

Another cool tool in the SysInternals suite is MoveFile and PendMoves. Rather than moving the file immediately the tool is used to move, rename or delete a file on restart. The System Manager looks at a special registry key to determine which files to are candidates to be operated on. I’ve created two cmdlets that mimic the function of the MoveFile tool. They both call the Win32 function MoveFileEx.

pinvoke

Move-FileOnReboot will (amazingly!) register a file to be moved on reboot.

movefile

Remove-FileOnReboot will do the same, except it will delete the file.

removefile

Get-PendingFileRenameOperation will return the files that are registered to be moved, renamed or delete.

pendmoves

I’ve also wrapped up the last two blog posts in this series in a module hosted on CodePlex. a module hosted on GitHub.

 

You can leave a response, or trackback from your own site.

2 Responses to “PoshInternals – Move-FileOnReboot, Remove-FileOnReboot and Get-PendingFileRenameOperation”

  1. [...] PostInternals – Move-FileOnReboot, Remove-FileOnReboot, Get-PendingFileRenameOperation [...]

  2. [...] PoshInternals – Move-FileOnReboot, Remove-FileOnReboot and Get-PendingFileRenameOperation and PoshInternals – Install-BlueScreenSaver (Adam Driscoll) [...]

Leave a Reply


three × = 12

Subscribe to RSS Feed Follow me on Twitter!