2011年4月22日 星期五

Windows 遠端桌面(mstsc) 的command

The Microsoft remote desktop client can be found in %systemroot%/system32/mstsc.exe. Running this program with no extensions will bring up the remote desktop connection program. However, mstsc.exe has a full set of switches that can be used to accomplish things from the command prompt.

mstsc.exe {ConnectionFile | /v:ServerName[:Port]} [/console] [/f] [/w:Width/h:Height] 

/v - specifies the remote computer and port (optional) you wish to connect to
/console – connects to the console of a Windows Server 2003 based system
/f – starts the remote desktop connection in full screen mode
/w & /h – specifies the width and height of the remote desktop connection

This can be very useful in creating batch files to use as quick routes to machines with a particular group of settings. For instance, mstsc.exe can be called from a batch file enforced by group policy to run at startup for machines that need to connect directly to a terminal server for use.



 @ you run mstsc /?, you will see that there are more options for it:



  • 參考網頁http://www.windowsnetworking.com/articles_tutorials/Configuring-Windows-Remote-Desktop-command-line.html
  • http://www.test104.com/tw/tech/6912.html
    遠端桌面mstsc /console連接的是session 0,而mstsc是另外打開一個虛擬的session,這樣的話就是相當與另外登陸電腦。也就是說帶console參數連接的是顯示器顯示的“實桌面”。很多時候需要用mstsc /console 打開遠端桌面才能看到所有的應用程式視窗,否則只能使用其他遠端工具連接才可見,比如VNC PcAnywhere等。


       問題1:伺服器上超出最大連接數。 
       我們除了重啟伺服器外,最好的方法就是使用/console(控制臺方式mstsc /console /v:IP:終端埠)進行登錄。比如mstsc /console /v:192.168.*.*:25000 


       問題2:windows xp 升級到sp3後不能使用mstsc /console連接到控制臺 
       windows xp升級到sp3後,命令換成mstsc /admin即可實現Xp2中mstsc /console的功能。 
       小提示:不管您使用的是微軟哪個版本的作業系統,如果您忘記了mstsc 的詳細參數,您可以在CMD下使用mstsc -help來查看具體的用法。

沒有留言:

熱門文章