PSExec:如何在远程计算机上显示 JPG 文件?

发布于 2024-07-14 12:20:55 字数 162 浏览 5 评论 0原文

我需要使用 PSExec 在远程计算机上启动文档而不是可执行文件。

我尝试向与 -c 命令关联的 psexec 提供 jpg 文件的文件名来复制该文件,但为文档(而不是可执行文件)返回的消息始终是“系统找不到指定的文件”。

有人知道 psexec 的命令行应该是什么吗?

I need to start a document on a remote computer instead of an executable file, using PSExec.

I tried to provide the file name of a jpg file to psexec associated with the -c command to copy the file, but the message returned for documents (and not executables) is always "The system cannot find the file specified."

Anyone any ideas what the command-line for psexec should be?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

酒浓于脸红 2024-07-21 12:20:55

尝试使用命令:

cmd.exe /c START c:\path\to\document.jpg

文档必须位于远程计算机上,因此在调用 psexec 之前必须通过其他命令将其复制到远程计算机上。

Try to use the command:

cmd.exe /c START c:\path\to\document.jpg

Document must be on the remote computer, so you have to copy it there by other command before calling psexec.

伤感在游骋 2024-07-21 12:20:55

在另一台机器上选择一个可以显示 JPEG 的程序并执行该程序,将要显示的文件的路径和名称传递给它。

正如您所注意到的,文件关联不适用于像这样的远程执行,因此您需要调用正确的程序。

Pick a program on that other machine that can show the JPEG and execute that, passing to it the path and name to the file you want to show.

As you've noticed, file associations doesn't work with remote execution like that, so you need to invoke the correct program instead.

挽梦忆笙歌 2024-07-21 12:20:55

为了打开远程程序并且不仅激活其进程,您必须使用 PSEXEC
与 -i(交互模式)一起并且必须定义会话号。

例如:

通常在 Win7 主机上:

 Console = Session 0
 System = Session 1
 User = Session 2

为了在此远程 Win 7 主机上激活并打开 notepad.exe,请使用以下语法:

psexec -i 2 \\ComputerName -u User -p Pass notepad.exe

问候,
沙伊夫
[电子邮件受保护]

In order to open a remote program and not only activate its process you have to use PSEXEC
with the -i (Interactive Mode) and MUST define the session number.

For example:

Usually on a Win7 host:

 Console = Session 0
 System = Session 1
 User = Session 2

In order to activate and open notepad.exe on this remote Win 7 host use the following syntax:

psexec -i 2 \\ComputerName -u User -p Pass notepad.exe

Regards,
Shai Ziv
[email protected]

留蓝 2024-07-21 12:20:55

这是对我有用的方式:

  • 我已通过 RDP 登录:
    • 我已将图片复制到“C:\Users\Pictures\smiley.png”
    • 我打开了一个新的 powershell 窗口,输入“tasklist”并找到了我的 Windows 会话 ID(我简单地获取了我找到的最高会话 ID)
  • 回到我自己的电脑上:

"C:\Program Files\PSTools\psexec" -s -i 4 "\\[RemoteComputerName]" "C:\Windows\system32\mspaint.exe" "C:\Users\[MyUserName]\Pictures\smiley.png"

PS:不要忘记替换 [RemoteComputerName] 和 [MyUserName]

This is the way that worked for me:

  • I've logged on to the via RDP:
    • I've copied a picture to the to "C:\Users<MyUserName>\Pictures\smiley.png"
    • I've opened a new powershell-window, typed "tasklist" and found out my windows session id (I simple took the highest session id I've found)
  • Back on my own PC:
    • I've downloaded PSTOOLS from https://download.sysinternals.com/files/PSTools.zip
    • I've unpacked PSTOOLS and placed it in "C:\Program Files\PSTools"
    • I've opened a new powershell-window and typed: cd "C:\Program Files\PSTools"
    • Finally i've started the remote PAINT with:

"C:\Program Files\PSTools\psexec" -s -i 4 "\\[RemoteComputerName]" "C:\Windows\system32\mspaint.exe" "C:\Users\[MyUserName]\Pictures\smiley.png"

P.S.: Don't forget to replace [RemoteComputerName] and [MyUserName]

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文