任务计划程序不执行批处理(BAT)与MSTest的命令文件 [英] Task Scheduler not executing batch (bat) file with MSTest commands

查看:285
本文介绍了任务计划程序不执行批处理(BAT)与MSTest的命令文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有设置日志文件路径和启动Visual Studio 2010 ordertests几个批处理文件。当我执行从Windows资源管理器的批处理文件它完美运行。问题是,当我使用Windows任务计划程序运行的批处理文件我orderedtest不执行。

样code:

  :::
:::这批揭开序幕searchinlineset测试集节点。
:::SetLogPath.vbs\\\\ spm08r2dw \\ ATPData \\门户网站的测试结果\\%COMSPEC%/ C呼%VS100COMNTOOLS%vsvars32.bat&放大器; MSTest的/testcontainer:\"%SmartUITestInstallPath%AUTs\\Tests\\DemoSuite\\SearchInlineSet\\SearchInlineSet.orderedtest\"\" / NOLOGO / usestderr

操作系统:Windows 7/2008 R2

任务计划程序配置图片:


  1. 常规:


  2. 设置:


  3. 条件:


  4. 编辑动作:


  5. 编辑触发器:



解决方案

导航到计划任务的常规选项卡,选择最高privleges运行。用户帐户更改为系统并且使用命令,允许验证参数在code传递如PowerShell命令启动BitsTransfer。

此外,填补了路径或参数编辑操作选项卡下的正确的开始是必要的。我用一个.bat文件来启动它,所以我填在框中启动。

I have several batch files which set a log file path and start visual studio 2010 ordertests. When I execute a batch file from windows explorer it runs perfectly. The problem is that when I use the Windows Task Scheduler to run a batch file my orderedtest is not executed.

Sample Code:

::: 
::: This batch kicks off the searchinlineset test set node.
:::

SetLogPath.vbs "\\spm08r2dw\ATPData\Webportal Test Results\"

%comspec% /c "call "%VS100COMNTOOLS%vsvars32.bat" & mstest /testcontainer:"%SmartUITestInstallPath%AUTs\Tests\DemoSuite\SearchInlineSet\SearchInlineSet.orderedtest"" /nologo /usestderr

OS: Windows 7/2008 r2

Task Scheduler Configuration Images:

  1. General:

  2. Settings:

  3. Conditions:

  4. Edit Action:

  5. Edit Trigger:

解决方案

Navigate to the General Tab of the Scheduled Task and select "run with highest privleges". Change the user account to SYSTEM and use a command that allows authentication parameters to be passed in the code such as the PowerShell cmdlet Start-BitsTransfer.

Also, fill in the correct start in path or arguments as necessary under the edit actions tab. I use a .bat file to kick it off, so I fill in the start in box.

这篇关于任务计划程序不执行批处理(BAT)与MSTest的命令文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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