Ok, look like nobody want to reply to this post (maybe they are lost in shrinking office ....

)
So here is how i do :
1 - Don't try replacing taskmgr.exe, there is a far better way to make process explorer your default task manager.
2 - tell your install script to copy process explorer to a path smaller than 400 caracteres (or maybe it's even less, i can't remember...) . Something like
%systemdrive%\WINNT (Win2000) or
%systemdrive%\WINDOWS(WinXp) is a good choice.
3 - then, it's time to apply that tricky trick of hell, the reg key who make all dreams come true :
CODE
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe]
"Debugger"="C:\\WINDOWS\\procexp.exe"
download the reg file :
Click to view attachmentand tell your script to add it to the reg database. something like :
REGEDIT /S 'YourPath'\taskxp.regto make it short this key can be used to replace any executable by the one of your choice (ex : replacing notepad by notepad++ or what ever...)
Et Voila...
Bonus Part :
to make process explorer start with your favorite columms, and windows view, do like this :
- customize it the way you want
- export key with all subkeys of
HKEY_CURRENT_USER\Software\Sysinternals\Process Explorer- tell your script to import the key ( REGEDIT /S )
- Et revoila...