4

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

user21034
  • 171
  • 6

2 Answers2

4

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.

Igal Serban
  • 1,575
  • 10
  • 6
  • This is exactly what was happening. I created an NTFS junction point and accessed it that way and I could see the file. – user21034 Sep 23 '09 at 19:09
2

Igal's answer is correct, but much of it applies only to outdated Windows versions. Here's a newer answer. It applies only to Windows Server 2008 or newer, or Windows Vista or newer.


Change into the C:\Windows\Sysnative directory. This is a virtual directory, so you can't use tab completion to get to it; you must type in its full name. Once you're there, you'll be able to see both qwinsta.exe and rwinsta.exe.

See my source for a fuller explanation of why this works.