One way to do this is to use the MoveFileEx function with the MOVEFILE_DELAY_UNTIL_REBOOT
flag and a NULL
destination. According to the documentation, this:
registers the lpExistingFileName file to be deleted when the system restarts. If lpExistingFileName refers to a directory, the system removes the directory at restart only if the directory is empty.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…