使用psexec在远程计算机上运行AutoIt [英] Run AutoIt on remote machine using psexec
问题描述
我正在尝试在远程计算机上运行AutoIt脚本.
I am trying to run an AutoIt script on a remote machine.
psexec.exe -accepteula \\remotemachine -u admin -p password "C:\Program Files\AutoIt3\AutoIt3.exe" "C:\Users\admin\runNotepad.au3"
我正在尝试从脚本中打开记事本并在其中编写一些内容.我也在写脚本中的一些日志.虽然我可以看到日志,但是我看不到屏幕上发生的任何事情.
I am trying to open a Notepad from the script and write something in it. I am also writing some logs from the script. Although I can see the logs, but I am not able to see anything happening on the screen.
我尝试使用参数-i 0
来打开一个交互式屏幕,该屏幕与在本地计算机上运行脚本不同.还有其他方法吗?
I tried with argument -i 0
which opens an interactive screen which is not same as running the script on a local machine. Is there any other way to do it?
推荐答案
最后,我能够弄清楚了.我们应该首先找出该用户的远程计算机的登录会话ID.我先使用psexec运行qwinsta命令来检查会话ID
Finally I was able to figure it out. We should first find out the logon session ID of the remote machine for that user. I ran qwinsta command using psexec first to check the session ID
psexec \\remote -u admin -p password qwinsta
这给了我所有会议的清单.检出活动会话,该会话具有与之关联的用户名. 在我的情况下是2.
This gives me a list of all the sessions. Checkout the active session the one which has a username associated with it. In my case it was 2.
然后我以会话ID为2运行此命令
Then I ran this command with session ID as 2
psexec.exe -i 2 -accepteula \\remotemachine -u admin -p password "C:\Program Files\AutoIt3\AutoIt3.exe" "C:\Users\admin\runNotepad.au3"
这篇关于使用psexec在远程计算机上运行AutoIt的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!