Rexec
為了在遠程 計算機上運行命令,運行 Windows Server?2003 家族成員、Windows?XP 和 Windows?2000 操作系統(tǒng)的計算機可以使用 Rexec 工具連接到提供 Rexec 服務(wù)(守護程序)并且該服務(wù)正在運行的非 Windows 計算機。在執(zhí)行指定命令之前,rexec 命令將驗證遠程計算機上的用戶名。不帶參數(shù)使用時,rexec 可以顯示幫助。
src="ms-its:c:\windows\help\UAshared.chm::/note.gif"> 注意
- 無法通過使用 rexec 命令連接到運行 Windows Server?2003 家族、Windows?XP 和 Windows?2000 操作系統(tǒng)的計算機,因為 Windows 操作系統(tǒng)不提供 Rexec 服務(wù)。
語法
rexec [Host] [-l UserName] [-n] [Command]
參數(shù)
- Host
- 通過 IP 地址或名稱來指定在其上運行 Command 的遠程主機(計算機)。
- -l UserName
- 指定遠程計算機上的用戶名。在省略情況下,使用當(dāng)前登錄用戶的名稱。
- -n
- 將 rexec 的輸入重定向到 NULL。這防止本地計算機命令結(jié)果的顯示。
- Command
- 指定要在遠程計算機上運行的命令。
- /?
- 在命令提示符下顯示幫助。
注釋
- 標準操作
rexec 命令提示用戶輸入密碼,然后在遠程計算機上驗證輸入的密碼。如果身份驗證成功,將運行該命令。
rexec 命令將標準輸入復(fù)制到遠程命令,將遠程 command 的標準輸出復(fù)制到其標準輸出,將遠程命令的標準錯誤復(fù)制到其標準錯誤。rexec 通常在遠程命令終止時終止。
- 使用重定向符號
在遠程計算機上進行重定向,要將重定向符號引在雙引號之內(nèi)(例如 ">>")。如果不使用雙引號,重定向在本地計算機進行。例如,以下命令將遠程文件 RemoteFile 附加到本地文件 LocalFile 中:
rexec othercomputer cat remotefile >>localfile
以下命令將遠程文件 remotefile 附加到遠程文件 otherremotefile 中:
rexec othercomputer cat remotefile ">>" otherremotefile
- 使用交互式命令
不能運行大多數(shù)交互式命令。例如,vi 或 emacs 不能通過使用 rexec 來運行。但是可以用 telnet 代替。
- 只有當(dāng)“Internet 協(xié)議 (TCP/IP)”在 href="EXEC=,rundll32.exe,SHELL32.DLL,Control_RunDLL ncpa.cpl CHM=UAShared.chm FILE=alt_url_windows_component.htm">
class=shortcut
src="ms-its:c:\windows\help\UAshared.chm::/shortcutCold.gif">class=space>
網(wǎng)絡(luò)連接中安裝為網(wǎng)絡(luò)適配器屬性的組件時,該命令才可用。