通过 PsExec 在远程机器上执行批处理文件 [英] Executing a batch file in a remote machine through PsExec

查看:35
本文介绍了通过 PsExec 在远程机器上执行批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过 PSExec 在远程 PC 上运行批处理文件(在我刚刚编写的记事本"批处理文件中).下面的 psexec 命令在我的笔记本电脑中运行,但无法在远程 PC 上执行任何操作.我什至没有看到在远程机器的进程列表上运行记事本".

I am trying to run a batch file (in the batch file I have just written 'notepad') on a remote PC through PSExec. The psexec command below runs in my laptop but fails to do anything on the remote PC. I don't even see 'notepad' running on the list of processes in the remote machine.

c:\Program Files (x86)\PSTools>psexec -u administrator -p force \\135.20.230.160 -s -d cmd.exe /c -c "C:\Amtra\bogus.bat"

PsExec v2.11 - Execute processes remotely
Copyright (C) 2001-2014 Mark Russinovich
Sysinternals - www.sysinternals.com


cmd.exe started on 135.24.237.167 with process ID 1520.

<小时>

任何人都可以帮助我哪里出错了?


Anyone can help me where I am going wrong here?

谢谢,

推荐答案

你有一个额外的 -c 需要去掉:

You have an extra -c you need to get rid of:

psexec -u administrator -p force \\135.20.230.160 -s -d cmd.exe /c "C:\Amitra\bogus.bat"

这篇关于通过 PsExec 在远程机器上执行批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆