@Richard

You're right, it's documented like that:

If this parameter is
an empty string (""), output is redirected to the screen.


But it wasn't clear for me, that this is an equivalent to "closing the file-datastream" \:\)

So far... I got my script working, but during the tests of my script I realized something else I don't understand.

I'll give a little overview to my script, that you are able to relate on my "little problem".

- I used kix2exe to "pack" all the necessary files.
- The logonscript.exe is placed on the logon share of our domain-controller

As I wrote above, sometimes it was necessary to create a temporary file, which gets placed in the "main logfile" later in the script, using the display() function.

I tried to place this tempfile in the %temp% directory of the current user like that:
 Code:
$out=redirectoutput("%temp%\tempfile.txt")

But the tempfile didn't appear, except I ran the script from my local hard disk drive.

At the moment, I redirect the tempfile to a share on our server. This works fine.

Somebody any idea?

Thanks, xFrog