Can’t see certain files under system32 via cygwin shell

cygwinwindows-server-2003

I'm using copSSH sshd on Windows Server 2003 to log in to a cygwin environment and boot abandoned Terminal Services sessions.

The server is a virtual machine hosted by my ISP, and the 'mstsc /console' trick doesn't seem to work.

There are 2 commands that I am interested in running from my cygwin session: qwinsta.exe and rwinsta.exe. My question is, why can I see/use qwinsta.exe but not rwinsta.exe? When I browse to /cygdrive/c/WINDOWS/system32 and list the contents of the directory, rwinsta.exe doesn't even show up.

I have compared permissions using cacls, and they are set up the same.
When I move rwinsta.exe to another folder, I can see it.
The file is not marked as system or hidden, what am I missing?

UPDATE: Fixed using answer below

1) install Server 2003 Resource kit tools
http://www.microsoft.com/Downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en

2) create a junction point

linkd c:\bin\realsys32 c:\WINDOWS\system32

3) add c:\bin\realsys32 to the system path

Best Answer

This is probably a X64 server. And the rwinsta.exe exist only in the real system32 folder.

ssh service on the server is x32 process. So it is redirected to syswow64 directory when it asks for the system32 directory. And this directory doesn't have the rwinsta.exe

You can find fix/Workaround in this article.