我试图远程运行这个批处理文件它将杀死IE进程,但当我尝试打开.lnk文件时,它不会这样做。 当我进入该计算机时,打开命令提示符并输入命令以运行它运行的.lnk文件,没有问题..请帮忙!
远程执行批处理文件的代码:
psexec -u Administrator -p password -i -d \\hostname "c:\Emergency_POD\test.bat"要运行的机器上的代码:(只有taskill命令工作..而不是for命令)cd /
taskkill /im iexplore.exe /f for %a in ("C:\Emergency_POD\*.lnk") do @start "" "%a"在cmd上运行的命令(此命令无问题:
for %a in ("C:\Emergency_POD\*.lnk") do @start "" "%a"I am trying to run this batch file remotely It will kill the IE process's but when I try to open a .lnk file it won't do it. When I go onto that machine, open up the command prompt and type in the command to run the .lnk file it works with no issues.. please help!
Code to remotely execute batch file:
psexec -u Administrator -p password -i -d \\hostname "c:\Emergency_POD\test.bat"Code on machine to run: (Only the taskill command works.. not the for command) cd/
taskkill /im iexplore.exe /f for %a in ("C:\Emergency_POD\*.lnk") do @start "" "%a"Command to run on cmd (This command works with no issues:
for %a in ("C:\Emergency_POD\*.lnk") do @start "" "%a"最满意答案
在批处理文件中使用%%a替代%a可能会更好。
You'd probably be better off with %%a in place of %a in the batch file.
更多推荐
发布评论