Thanks a lot for your answers.
I'll probably try using
%COMMANDER_PATH% and/or
%TEMP% to store these sections in a normal way, and experiment with NUL-redirects in TC only on my private test systems at first (imagine the mess, if the function manages to create a file with that name)...
If you omit the path in lpFileName, WritePrivateProfileString searches the Windows directory.
So I assume, using NUL with this function is impossible (always the WinDir is added to the string).
Meanwhile I found an even more brutal way, probably with less risk - at least it should be more difficult to accidentally create a file with
this name, I guess
:
[SearchName]
RedirectSection=:\
Feature suggestion, if it's not too much effort: Maybe the name "
NUL" could be detected and the function in TC could return without executing
WritePrivateProfileString (return value 1 like the original) to take away the danger? This should be enough to
emulate the use of the
real NUL device, I think.
What do you think, worth a try?