I'm using AutoHotkey v1.1.34.03 on Windows 7 64-bit.
My script (it's a long one, I think no code is necessary) uses SysInternals tool "MoveFile.exe to delete some log files on next reboot, and which are currently locked, like that one of Task Scheduler.
That action puts two strings in "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations" - old file name, and new file name. When deleting (locked) file,
new file name is empty string. Also, various uninstallers use that key and put stuff into it. So, in case of multiple file deletions, contents of that registry value would be:
Code: Select all
OLD_FILE_1
<empty line>
OLD_FILE_2
<empty line>
OLD_FILE_3
<empty line>
...
converting 2 x 0x00 bytes into newlines and string returned is
Code: Select all
OLD_FILE_1
<NUL>OLD_FILE_2<NUL><NUL>OLD_FILE_3<NUL><NUL>
It reads properly registry key into variable, but breaking that up into lines is broken.
Or maybe I'm missing something and doing something wrong. I've tested that with pre-allocated-and-zeroed variable, and using RawWrite() to check it's content.
BTW. Thanks to authors of AutoHotkey, it has really almost completely eradicated my need to use bash-shell scripts, or even C. Today, I "mastered" custom ListView sorting via SendMessage() and callback