View Single Post
Old 5th February 2008, 23:27   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,888
Turns out I made example code for someone in the nsis IRC channel a long time ago to handle this

Comparing Instructor's code with mine and my notes, you should call GetStdHandle first, then AttachConsole, and use the built in FileWrite command and not WriteConsole, if you do this, you can use pipes and redirection (foo.exe > out.txt etc.) still limited to XP and up

so, without any error handling or anything:
PHP Code:
System::Call 'kernel32::GetStdHandle(i -11)i.r0'
System::Call 'kernel32::AttachConsole(i -1)'
FileWrite $"hello" 

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote