windows自带的远程桌面客户端mstsc是不能自动登录,据说是为了安全原因。
mstsc [<connection file>] [/v:<server[:port]>] [/admin] [/f[ullscreen]] [/w:<width>] [/h:<height>] [/public] | [/span] [/edit "connection file"] [/migrate] [/?]
在网上可以下载一个autordp.exe的小工具,能实现远程桌面的自动登录。
Autordp [<Connection File>] [/v:server[:port]>] [/u:<user>] [/p:<Password>] [/console]
但上面的小工具不能和windows 7的mstsc兼容。只好用windows2003的把 mstsc.exe , mstscax.dll两个文件替换。用如下的命令:
takeown /f c:\windows\system32\mstsc.exe 
icacls c:\windows\system32\mstsc.exe /grant administrators:F /t 
attrib -r -a -s -h  c:\windows\system32\mstsc.exe /s 
copy  c:\windows\system32\mstsc.exe c:\ 
del /q /s /f  c:\windows\system32\mstsc.exe 
copy d:\windows\system32\mstsc.exe  c:\windows\system32 /y
takeown /f c:\windows\system32\mstscax.dll 
icacls c:\windows\system32\mstscax.dll /grant administrators:F /t 
attrib -r -a -s -h  c:\windows\system32\mstscax.dll /s 
copy  c:\windows\system32\mstscax.dll c:\ 
copy  c:\windows\system32\mstscax.dll c:\windows\system32\mstscax-windows7.bak.dll 
del /q /s /f  c:\windows\system32\mstscax.dll 
copy d:\windows\system32\mstscax.dll  c:\windows\system32 /y