通过 wmic 远程执行包含 exe 路径的批处理文件 [英] Executing a batch file containing an exe path remotely via wmic
本文介绍了通过 wmic 远程执行包含 exe 路径的批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在计算机 A 上有一个批处理文件,其中包含几个命令和一个 exe 文件的路径.
I have a batch file on Computer-A that contains several commands and a path to an exe file.
当我通过 wmic 在 Computer-B 上执行批处理文件时,除了不运行 exe 之外,我可以看到批处理文件中正在执行的所有命令.我需要检查哪些内容才能了解为什么 .exe 没有在计算机 A 上执行?
When I execute the batch file on Computer-B via wmic, I can see all the commands being executed in the batch file except that it does not run the exe. What are the things I need to check for to see why the .exe is not being executed on Computer-A?
wmic 执行:
wmic /node:"<server_ip>" /user:domain\user /PASSWORD:"password" /OUTPUT:STDOUT process call create "cmd.exe /c C:\Folder\batch.bat"
推荐答案
wmic 中的文件路径需要是 c 风格的路径.所以C:\\somefolder\\somefile.ext
.\\
for \
在路径中.
File paths in wmic need to be c style paths. So C:\\somefolder\\somefile.ext
. \\
for\
in paths.
这篇关于通过 wmic 远程执行包含 exe 路径的批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文