简体   繁体   English

从RPC执行时Windows START命令无法运行

[英]Windows START command failing to run when executed from RPC

Long story short I have written a program that allows me to install software and run commands on Windows machines remotely. 长话短说,我写了一个程序,使我可以在Windows机器上远程安装软件和运行命令。 I have been using the START command (which i learned about from another post on stackoverflow found here ) to execute the batch file through RPC so that my server doesn't have to wait for the install to finish. 我一直在使用START命令(我了解从另一个岗位上计算器发现这里 )通过RPC,执行批处理文件,这样我的服务器不必等待安装完成。 It works fine on most of the 1000 computers at the school district I wrote this for, but I have a few computers that the START doesn't run the batch file. 在我为之编写的学区中,大多数1000台计算机都可以正常运行,但是我有几台START不能运行批处理文件的计算机。 I am not getting any error messages and all of the searching I have done only finds more examples of how to use the START command. 我没有收到任何错误消息,而我所做的所有搜索仅找到有关如何使用START命令的更多示例。 I have not been able to find any references to it simply not running. 我一直无法运行,但找不到任何引用。

My server is linux and is using winexe for the RPC. 我的服务器是linux,并且正在使用winexe作为RPC。 Here is the command that I am running. 这是我正在运行的命令。

winexe -W domain -U adminUser --password=adminPassword //compName.domain.internal --runas=domain\\adminUser%adminPassword "\\\\Server\\PathToBatch\\run.cmd \\\\Server\\PathToBatch\\install.cmd"

The run.cmd code is below. 下面是run.cmd代码。

START %1
exit

The install.cmd batch file is generated by my program depending on what they want to install. install.cmd批处理文件由我的程序生成,具体取决于他们要安装的内容。 The extra \\s in the command are escape characters because the \\ is the escape character in linux. 命令中多余的\\是转义字符,因为\\是Linux中的转义字符。

The output I get is. 我得到的输出是。

C:\WINDOWS\system32>start \\Server\PathToBatch\install.cmd 
C:\WINDOWS\system32>exit

No error messages, and the output is the same on a computer that does start correctly. 没有错误消息,并且在正确启动的计算机上输出是相同的。

I have tried running the command from a command prompt on the machine exactly as it is run through RPC and it works fine. 我尝试从计算机上的命令提示符处运行命令,就像通过RPC运行一样,并且工作正常。 I can run the install.cmd by its self using RPC and it works fine except I have to wait for the install to finish. 我可以使用RPC自行运行install.cmd,除了我必须等待安装完成之外,它可以正常运行。 The exact same batch files can be run on other computers without problems. 完全相同的批处理文件可以在其他计算机上运行而不会出现问题。

Watching Task Manager on a computer that works I can see a cmd process run by the adminUser start and then start a second cmd process and the first goes away. 在工作正常的计算机上观看任务管理器,我可以看到adminUser启动了一个cmd进程,然后启动了第二个cmd进程,第一个cmd进程消失了。 On a non working computer it starts the first cmd process and goes away without the second cmd process ever starting. 在无法正常运行的计算机上,它将启动第一个cmd进程,然后消失,而第二个cmd进程从未启动。

I have not been able to find any differences between the working computer and non working computer. 我无法在工作计算机和非工作计算机之间找到任何区别。 There is no firewall on the computers. 在计算机上没有防火墙。

We will be re-imaging these computers during summer break and I expect they will probably start working after that, so it isn't urgent that I figure this out. 我们将在暑假期间对这些计算机进行重新映像,我希望它们在此之后可能会开始工作,因此我不急于解决这个问题。 I mainly want to know why it isn't working so that I can prevent it from failing in the future on other machines. 我主要想知道为什么它不起作用,以便可以防止将来在其他计算机上失败。

Thanks in advance for any help you can give me. 预先感谢您可以给我的任何帮助。

Try start "" %1 instead of start %1 . 尝试start "" %1而不是start %1 Also double-check if the runas user can actually access \\\\Server\\PathToBatch on the machines where the command fails. 还要仔细检查runas用户是否可以实际访问命令失败的计算机上的\\\\Server\\PathToBatch

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在Windows中的Makefile中运行“启动”命令 - cannot run 'start' command from makefile in windows 在Windows命令提示符下运行上次执行的命令 - Run the last executed command in Windows command prompt 当通过Windows START命令执行命令时,如何重定向命令的输出 - How do I redirect the otuput of a command when it is executed via the Windows START command 从Matlab执行时缺少Windows命令行历史记录 - Missing windows command line history when executed from Matlab 从Java中的ProcessBuilder执行时,Windows REG命令不起作用 - Windows REG command not working when executed from ProcessBuilder in Java 运行命令execute.Start()时,WPF应用程序在Windows 7上崩溃 - WPF Application crashes on WIndows 7 when command executable.Start() is run 在Python中启动Windows运行命令(浏览器协议) - Start a Windows Run command in Python (Browser protocol) 有什么方法可以重定向Windows命令行中以“开始”运行的命令的stderr输出? - Is there any way to redirect stderr output from a command run with “start” in the Windows command line? 有什么方法可以重定向 Windows 命令行中使用“start”运行的命令的 stderr 输出? - Is there any way to redirect stderr output from a command run with "start" in the Windows command line? 从命令窗口执行并双击bat文件时,Windows .Bat文件的行为有所不同 - Windows .Bat file behave differently when executed from command window and by double clicking on the bat file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM