批处理文件无法通过任务调度程序从Visual Studio运行已发布的可执行文件 [英] batch file can not run published executable file from Visual studio by task scheduler
问题描述
批处理文件无法通过任务调度程序从Visual Studio运行已发布的可执行文件
batch file can not run published executable file from Visual studio by task scheduler
in window 2008 R2
in window 2008 R2
i使用下面的批处理文件并设置本地服务帐户运行,并已将本地服务完全控制权分配给批处理和可执行文件
i use a batch file below and set local service account to run, and already assign local service full control right to batch and executable file
@echo off
start C:\Users\Administrator\AppData\Local\Apps\2.0\8DXLB5YX.YVA \ QQT44L4Y.OQ6 \smar..tion_d42111ad34239f37_0001.0000_b873c0b6222ba08f\SmartSatelliteVideoMonitoring.exe
@echo off
start C:\Users\Administrator\AppData\Local\Apps\2.0\8DXLB5YX.YVA\QQT44L4Y.OQ6\smar..tion_d42111ad34239f37_0001.0000_b873c0b6222ba08f\SmartSatelliteVideoMonitoring.exe
并在任务计划程序中运行此批处理文件
and run this batch file in Task Scheduler
但按下Run或预定时间触发器后窗口中没有响应和winform显示
but no response and winform show in window after press Run or scheduled time trigger
它只能通过手动点击批处理文件来运行
it can only run by click the batch file manually
我已经关注了
i had already followed
https://serverfault.com/questions/734035/running-a-batch-file-from-task-scheduler-without-user-being-logged-in
https://serverfault.com/questions/734035/running-a-batch-file-from-task-scheduler-without-user-being-logged-in
但是我没有安装 KB977353 因为
似乎与这种情况无关
MEALY
推荐答案
嗨MEALY,
Hi MEALY,
我认为您使用ClickOnce发布您的应用程序,我有一个在我的计算机中测试:
I think you use ClickOnce to publish your application, and I have a test in my compute:
步骤1,使用ClickOnce部署应用程序,.exe文件位于文件夹中:
Step 1, deploy a application with ClickOnce and the .exe file is in the folder:
C:\Users\v-baf\AppData\Local\Apps\2.0\OWBZ447N.JV2\14H13VLL.096\winf..tion_592fccc83ff3e24b_0001.0000_77de75488ee0d5ad\WinFormApplication20170519 + .EXE
C:\Users\v-baf\AppData\Local\Apps\2.0\OWBZ447N.JV2\14H13VLL.096\winf..tion_592fccc83ff3e24b_0001.0000_77de75488ee0d5ad\WinFormApplication20170519+.exe
第2步, 写一个.txt文件,如下所示:
Step 2, write a .txt file like this:
然后将文件扩展名更改为bat并将其保存到我的D盘。
Then change the file extension to bat and save it to my D drive.
步骤3,使用任务计划程序运行,它可以显示表单:
Step 3, Run with the task scheduler, it can show me the Form:
所以请参考完整的步骤。
So please refer to this complete steps.
或者请提供更多详细信息发布您的应用程序并确保您的发布步骤成功,并提供有关如何使用cmd语句运行批处理文件的更多步骤。
Or please provide more details about how do you publish your application and make sure your step of publish is successful, and provide more steps about how to run the batch file with the cmd statement.
最好的问候,
Stanly
这篇关于批处理文件无法通过任务调度程序从Visual Studio运行已发布的可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!