㈠ mstsc 保存用戶名和密碼,實現自動登錄遠程桌面
首先手動連接遠程桌面,登陸時記得保存連接,得到.rdp文件。
在.rdp文件中結尾處添加用戶名以及密碼信息:
username:s: yourname
password 51:b: yourpasswd
批處理命令:
start "RemoteConsole %destIP%" mstsc %destIP%.rdp /v:%destIP%
密碼生成工具
https://www.remkoweijnen.nl/blog/2007/10/18/how-rdp-passwords-are-encrypted/
/////////////////////////////////////////////
以下為 Python (Version 2.7)腳本一鍵登陸遠程桌面:
#coding:utf-8
import win32crypt
import binascii
import os
import Tkinter
import tkMessageBox
import tkFileDialog
def genRdpPasswd(passwd):
#passwd must be unicode!!!!!!!!!!!!!!!!!!!!!!!!!!
pwdHash = win32crypt.CryptProtectData(passwd, u'psw', None, None, None, 0)
pwdHash_ok = binascii.hexlify(pwdHash)
#print len(pwdHash_ok)
#print pwdHash_ok
return pwdHash_ok
def logIn():
rdpStr = u'''screen mode id:i:2
use multimon:i:0
desktopwidth:i:1920
desktopheight:i:1080
session bpp:i:32
winposstr:s:0,1,917,8,1744,1003
compression:i:1
keyboardhook:i:2
audiocapturemode:i:0
videoplaybackmode:i:1
connection type:i:7
networkautodetect:i:1
bandwidthautodetect:i:1
displayconnectionbar:i:1
enableworkspacereconnect:i:0
disable wallpaper:i:0
allow font smoothing:i:0
allow desktop composition:i:0
disable full window drag:i:1
disable menu anims:i:1
disable themes:i:0
disable cursor setting:i:0
bitmapcachepersistenable:i:1
audiomode:i:0
redirectprinters:i:1
redirectcomports:i:0
redirectsmartcards:i:1
redirectclipboard:i:1
redirectposdevices:i:0
autoreconnection enabled:i:1
authentication level:i:2
prompt for credentials:i:0
negotiate security layer:i:1
remoteapplicationmode:i:0
alternate shell:s:
shell working directory:s:
gatewayhostname:s:
gatewayusagemethod:i:4
gatewaycredentialssource:i:4
gatewayprofileusagemethod:i:0
promptcredentialonce:i:0
gatewaybrokeringtype:i:0
use redirection server name:i:0
rdgiskdcproxy:i:0
kdcproxyname:s:
drivestoredirect:s:
'''
ip = ipVar.get().decode('utf-8')
username = usernameVar.get().decode('utf-8')
passwd = passwdVar.get().decode('utf-8')
passwd_encrypt = genRdpPasswd(passwd)
print len(ip), ip
print len(username), username
print len(passwd), passwd
print len(passwd_encrypt), passwd_encrypt
rdpStr = rdpStr + "full address:s:%s\r\nusername:s:%s\r\npassword 51:b:%s\r\n"%(ip, username, passwd_encrypt)
with open("AutoRdp.rdp","w") as f:
f.write(rdpStr)
#os.system('start "RemoteConsole %s %s" mstsc AutoRdp.rdp /v:%s'%(ip, username, ip))
os.system('start "RemoteConsole %s %s" mstsc AutoRdp.rdp'%(ip, username))
if "__main__" == __name__:
root = Tkinter.Tk()
ipVar = Tkinter.StringVar()
usernameVar = Tkinter.StringVar()
passwdVar = Tkinter.StringVar()
ipVar.set(u'your default ip')
usernameVar.set(u'your default username')
passwdVar.set(u'your default passwd')
root.title('AutoRdp')
#root.withdraw()
Tkinter.Label(root, text = 'IpAddr:').grid(row = 0, column = 0)
Tkinter.Entry(root, textvariable = ipVar).grid(row = 0, column = 1)
Tkinter.Label(root, text = 'UserName:').grid(row = 1, column = 0)
Tkinter.Entry(root, textvariable = usernameVar).grid(row = 1, column = 1)
Tkinter.Label(root, text = 'PassWord:').grid(row = 2, column = 0)
Tkinter.Entry(root, textvariable = passwdVar).grid(row = 2, column = 1)
Tkinter.Button(root, text = '遠程登陸', command = logIn).grid(row = 3, column = 2)
root.mainloop()
㈡ 遠程桌面連接時怎麼把本地電腦的文件上傳到遠程電腦
想要在遠程桌面(Remote Desktop,簡稱RDP)與本地系統之間傳遞文件,有兩種方式,都需要在登陸遠程桌面前設置:
方法一:
1.在登陸遠程桌面的窗口中,展開【選項】,如圖:
2.展開【驅動器】,然後勾選文件所在的驅動器,這樣在遠程桌面連接後,就可以在資源管理器中看到所勾選的本地磁碟,這時,就像在遠程桌面中多了一個驅動器,在遠程桌面中操作這個驅動器與其他原本在RDP中的驅動器完全一樣。
㈢ mstsc鏂囦歡澶規斁鍦ㄥ摢閲岋紵
銆銆mstsc涓鑸鍦╓indows鐨凜鐩:\Windows\System32鏂囦歡澶逛笅銆
銆銆Mstsc (Microsoft terminal services client)鏄鍒涘緩涓庣粓絝鏈嶅姟鍣ㄦ垨鍏朵粬榪滅▼璁$畻鏈虹殑榪炴帴錛岀紪杈戠幇鏈"榪滅▼妗岄潰榪炴帴(.rdp)"閰嶇疆鏂囦歡錛屽苟灝 Windows XP 榪炴帴(浣跨敤"瀹㈡埛絝鍥介槻閮ㄨ懼 鎺ョ$悊鍣"鍒涘緩鐨勮繛鎺)榪佺Щ鍒版柊鐨 .rdp 鏂囦歡涓銆
銆銆Mstsc榪樻湁涓縐嶈存硶錛孧icrosoft Telnet Screen Control 錛屽嵆"寰杞榪滅▼妗岄潰鎺у埗"銆
銆銆鏂囦歡澶規槸涓撻棬瑁呮暣欏墊枃浠剁敤鐨勶紝涓昏佺洰鐨勬槸涓轟簡鏇村ソ鐨勪繚瀛樻枃浠訛紝浣垮畠鏁撮綈瑙勮寖銆傛櫘閫氳$畻鏈烘枃浠跺す鏄鐢ㄦ潵鍗忓姪浜轟滑綆$悊璁$畻鏈烘枃浠剁殑錛屾瘡涓涓鏂囦歡澶瑰瑰簲涓鍧楃佺洏絀洪棿錛屽畠鎻愪緵浜嗘寚鍚戝瑰簲絀洪棿鐨勫湴鍧錛屽畠娌℃湁鎵╁睍鍚嶏紝涔熷氨涓嶅儚鏂囦歡鐨勬牸寮忕敤鎵╁睍鍚嶆潵鏍囪瘑銆