vncdotool - A command line VNC client
作者:Daly 出处:http://www.cnblogs.com/daly 欢迎转载,也请保留这段声明。谢谢!
之前的一个项目需要需求希望可以通过命令行去远程执行一些Windows 系统操作。
所以决定采用: Python + vnctool
环境准备:
1. 2 台Windows机器。 其中一台作为lead机器, 一台作target机器。
2. Python2.7.5, VNC-5.0.5安装包和其他一些依赖包。 具体可以参考以下步骤。
On the lead machine:
1. Install Python2.7
1.1. Start with a Windows
1.2. Install python via python-2.7.5.msi
1.3. Set the Environment Variables (2 methods):
a. Open up PowerShell, and paste in the following:
[Environment]::SetEnvironmentVariable("Path",
"$env:Path;C:\Python27\;C:\Python27\Scripts\", "User")
b. Right click Computer and select "Properties" > click "Advanced system settings" > click "Environment Variables..." > select "Path" in "System variables" field and click "Edit" > add "C:\Python27\;C:\Python27\Scripts\;" at the "Variable value"
2. Install Twisted
2.1. Install Twisted via Twisted-13.1.0.win32-py2.7.exe
3. Install PIL
3.1. Install PIL via PIL-1.1.7.win32-py2.7.exe
4. Copy 2 scripts to C:\Python27\Scripts
4.1. Copy file ez_setup.py and get-pip.py to C:\Python27\Scripts
5. Install setuptools
5.1. Download setuptools-1.1.6
5.2. Launch CMD and input the follow commands to install setuptools:
> cd c:\setuptools-1.1.6
> python setup.py install
6. Install pip
6.1. Download pip-1.4.1
6.2. Launch CMD and input the follow commands to install pip:
> cd c:\pip-1.4.1
> python setup.py install
7. Install distribute
7.1. Download distribute-0.7.3
7.2. Launch CMD and input the follow commands to install distribute:
> cd c:\distribute-0.7.3
> python setup.py install
8. Install zope.interface
8.1. Download zope.interface-4.05
8.2. Launch CMD and input the follow commands to install zope.interface:
> cd c:\zope.interface-4.05
> python setup.py install
9. Install vncdotool
9.1. Download vncdotool -0.8.0
9.2. Launch CMD and input the follow commands to install vncdotool:
> cd c:\vncdotool -0.8.0
> python setup.py install
VNC Server installation(Install it on the lead machine and the target machine)
1. Install VNC Server
1.1. Download VNC-5.0.5-Windows.exe
1.2. Install VNC via VNC-5.0.5-Windows.exe
VNC Configuration (Configure it on the lead machine and the target machine)
1. After install VNC Server successfully, right click VNC icon in the bottom right corner of the toolbar > select "Options..."
2. Then select the "Advanced..." button:
3. Choose Authentication as "VNC password" and click "Configure.." > input the password to configure > choose Encryption as "Prefer off"
4. Select tab "Expert" > set the "ProtocolVersion" for the VNCServer to 4.0.
5. Click "Apply" and click "OK" to finish the configuration
VNCDO usage
1. Test the vncdo take effect:
On the lead machine, at the CMD prompt input:
> vncdo.exe -s xxx.xxx.xxx.xxx[the target machine's ip] -p password[the password you set at VNC Configuration #3] capture screenshot.png
you will get the target machine's currently screenshot
2. vncdo usage
a. Input "vncdo --help" in CMD to get the vncdo all usage
b. Some useful usage:
>vncdo -s xxx.xxx.xxx.xxx -p password type "hello"
>vncdo -s xxx.xxx.xxx.xxx -p password key ctrl-alt-del expect a.png 0
>vncdo -s xxx.xxx.xxx.xxx -p password type "administrator" key tab type "password" key enter expect d.png 0
3. Get more info from the website: http://pythonhosted.org/vncdotool/
https://pypi.python.org/pypi/vncdotool
vncdotool - A command line VNC client的更多相关文章
- Proxy settings in TortoiseSVN and command line svn client
The server file is created when you install TortoiseSVN, Eclipse or command-line Subversion. Use the ...
- Can't use Subversion command line client: svn Probably the path to Subversion executable is wrong. Fix it.
1.最近使用SVN工具时,Checkout出项目到本地后后,然后将其导入到Intellij idea中开发,在提交svn代码的时候,出现这样的错误:Can't use Subversion comma ...
- 使用intellij的svn时提示出错: Can't use Subversion command line client: svn.Errors found while svn working copies detection.
使用Intellij的svn时提示出错:Can't use Subversion command line client: svn. Errors found while svn working co ...
- Can't use Subversion command line client:svn
在Intellij IDEA里checkout东西时出先这个错误提示:Can't use Subversion command line client:svn Subversion command l ...
- MySQL 5.7 Command Line Client输入密码后闪退和windows下mysql忘记root密码的解决办法
MySQL 5.7 Command Line Client输入密码后闪退的问题: 问题分析: 1.查看mysql command line client默认执行的一些参数.方法:开始->所有程序 ...
- Android Studio集成SVN报错:can't use subversion command line client : svn
Android Studio集成SVN插件,check out出代码后,每次开启都会在右上角出现如下错误: Can't use Subversion command line client: svn ...
- MySQL中MySQL X.X Command Line Client一闪而过的问题
问题介绍:我安装完MySQL(我安装的是5.5)后,使用MySQL 5.5 Command Line Client,每次点击,总是一闪而过.解决方法如下: 首先进入cmd 切入MySQL的安 ...
- Webstorm 提示 Can't use Subversion command line client
Webstorm 提示 Can't use Subversion command line client Webstorm 提示 Can't use Subversion command line c ...
- Mysql安装后打开MySQL Command Line Client闪退解决方法
1.开始菜单下;Mysql--->mysql server 5.6-->mysql command line Client ---右击,选择属性 2.在属性下查看目标位置: 3.将安装目录 ...
随机推荐
- Cocos2D v3.4.9粒子效果不能显示的原因分析及解决办法
大熊猫猪·侯佩原创或翻译作品.欢迎转载,转载请注明出处. 如果觉得写的不好请多提意见,如果觉得不错请多多支持点赞.谢谢! hopy ;) 在游戏App中为了衬托气氛我们往往使用一些特殊的图形效果,粒子 ...
- How To: Run Tapestry5 On JBoss 6/7
Tapestry 5.x cannot find the core pages and components from the URLs provided from classloaders in J ...
- Android初级教程之内容提供者获取联系人信息
内容提供折详细理论知识请参考之前的博文:http://blog.csdn.net/qq_32059827/article/details/51646513 这里新建了三个联系人信息,通过查看系统联系人 ...
- 【Unity技巧】制作一个简单的NPC
1. 写在前面 前几天看了cgcookie的一个教程,学习了下怎么根据已有人物模型制作一个仿版的NPC人物,感觉挺好玩的,整理一下放到博客里! 先看一下教程里面的最终效果. 是不是很像个幽灵~ 下面是 ...
- UNIX环境高级编程——无名管道和有名管道
一.进程间通信 每个进程各自有不同的用户地址空间,任何一个进程的全局变量在另一个进程中都看不到,所以进程之间要交换数据必须通过内核,在内核中开辟一块缓冲区,进程1把数据从用户空间拷到内核缓冲区,进程2 ...
- JAVA内部类_1
使用内部类的原因: (1)可以访问该类定义所在作用域中的数据,包括私有数据. (2)可以对同一个包中的其它类隐藏起来. (3)当想要定义一个回调函数且不想编写大量代码时,使用匿名内部类比较便捷. 下面 ...
- 读书笔记 - reword (重来)
reword (重来) 虽然我是一个不是很喜欢看书的人,但是公认的是看书对提高个人的水平是很有帮助的. 而且我想,如果我要写一本书,我一定会经过多次校验.经过长时间思考确保无误后才会出版的.所以我想看 ...
- Linux IPC实践(4) --System V消息队列(1)
消息队列概述 消息队列提供了一个从一个进程向另外一个进程发送一块数据的方法(仅局限于本机); 每个数据块都被认为是有一个类型,接收者进程接收的数据块可以有不同的类型值. 消息队列也有管道一样的不足: ...
- SwiftyiRate中文说明
SwiftyiRate Github SwiftyiRate Swift语言实现的app内评分,简单易用. Requirements Integration Usage Initialization ...
- Gradle脚本打包so库
要让引用的第三方的so库被打包进去,只需要把相关的armeabi文件夹放在libs下面,然后在builld.gradle脚本中加上这一句: sourceSets{ main { jniLibs.src ...