【发布时间】:2015-11-13 14:44:08
【问题描述】:
我正在尝试自动登录到 2008 R2 服务器上的一组 RDP 客户端,当从桌面双击批处理文件时,下面的批处理工作正常,但是将 .bat 文件设置为运行时没有任何反应来自任务计划程序的任务
@ECHO off
ECHO This .bat is used to automatically RDP in to the specified servers
ECHO which are contained within this file. Ensure you have logged in to
ECHO these servers beforehand and checked 'save credentials' otherwise
ECHO this batch file won't work as intended.
ECHO.
ECHO Beginning login...
ECHO.
ECHO Beginning login - Server ADMIN...
start mstsc.exe /v:00.00.00.00 /admin
PAUSE
计划任务设置为在管理员帐户下运行(只有一个可用),并且(开始)可选字段也已设置为“C:\Users\Administrator\Desktop\”。
【问题讨论】:
-
如果
administrator已登录,作业是否开始? -
在桌面上双击脚本从哪里开始?即提示符是c:\users\admin\desktop,还是c:\windows\system32?可能是您通过强制它在桌面上启动而无意中破坏了它。
-
不,它没有在管理员登录的情况下运行,我最初尝试过测试!
-
1.您可以尝试提供
mstsc.exe的完整路径,例如:"C:\Windows\System32\mstsc.exe"(只是猜测); 2. 尝试在start和路径之间插入"",例如:start "" "C:\Windows\System32\mstsc.exe" /v:00.00.00.00 /admin(start可能将第一个参数解释为窗口标题而不是路径);
标签: windows batch-file scheduled-tasks windows-server-2008-r2