㈠ 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 锛屽嵆"寰杞杩滅▼妗岄潰鎺у埗"銆
銆銆鏂囦欢澶规槸涓撻棬瑁呮暣椤垫枃浠剁敤鐨勶紝涓昏佺洰鐨勬槸涓轰簡鏇村ソ鐨勪繚瀛樻枃浠讹紝浣垮畠鏁撮綈瑙勮寖銆傛櫘閫氳$畻鏈烘枃浠跺す鏄鐢ㄦ潵鍗忓姪浜轰滑绠$悊璁$畻鏈烘枃浠剁殑锛屾瘡涓涓鏂囦欢澶瑰瑰簲涓鍧楃佺洏绌洪棿锛屽畠鎻愪緵浜嗘寚鍚戝瑰簲绌洪棿鐨勫湴鍧锛屽畠娌℃湁鎵╁睍鍚嶏紝涔熷氨涓嶅儚鏂囦欢鐨勬牸寮忕敤鎵╁睍鍚嶆潵鏍囪瘑銆