Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/336.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 最小化运行计划任务_C#_Windows 10_Scheduled Tasks_Minimized - Fatal编程技术网

C# 最小化运行计划任务

C# 最小化运行计划任务,c#,windows-10,scheduled-tasks,minimized,C#,Windows 10,Scheduled Tasks,Minimized,我已经设置了一个控制台应用程序,使用Windows调度程序每分钟运行一次。但是,当计划任务运行时,会短暂弹出一个CMD屏幕。这是一种恼人的,我希望任务启动时最小化,然后关闭 根据现有资源,我已尝试: 1) “无论用户是否登录都运行”:不会发生任何事情,如果执行成功,我在文件中看不到任何应该发生的条目 2) 从.exe创建快捷方式并使快捷方式运行最小化:快捷方式转换为实际应用程序并最大化运行。如果将控制台应用程序编译为Windows应用程序,它将同时隐藏cmd窗口 如果使用Visual Studi

我已经设置了一个控制台应用程序,使用Windows调度程序每分钟运行一次。但是,当计划任务运行时,会短暂弹出一个CMD屏幕。这是一种恼人的,我希望任务启动时最小化,然后关闭

根据现有资源,我已尝试:

1) “无论用户是否登录都运行”:不会发生任何事情,如果执行成功,我在文件中看不到任何应该发生的条目


2) 从.exe创建快捷方式并使快捷方式运行最小化:快捷方式转换为实际应用程序并最大化运行。

如果将控制台应用程序编译为
Windows应用程序
,它将同时隐藏
cmd
窗口


如果使用Visual Studio,请右键单击项目->属性->应用程序->输出类型:->Windows应用程序

对于初学者,如果正在运行控制台应用程序,请尝试在命令提示符下运行
启动/?
。尝试
/min
选项以查看是否有帮助

C:\Users\help.me>start /?
Starts a separate window to run a specified program or command.

START ["title"] [/D path] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
  [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
  [/NODE <NUMA node>] [/AFFINITY <hex affinity mask>] [/WAIT] [/B]
  [command/program] [parameters]

"title"     Title to display in window title bar.
path        Starting directory.
B           Start application without creating a new window. The
            application has ^C handling ignored. Unless the application
            enables ^C processing, ^Break is the only way to interrupt
            the application.
I           The new environment will be the original environment passed
            to the cmd.exe and not the current environment.
MIN         Start window minimized.
MAX         Start window maximized.
SEPARATE    Start 16-bit Windows program in separate memory space.
SHARED      Start 16-bit Windows program in shared memory space.
LOW         Start application in the IDLE priority class.
NORMAL      Start application in the NORMAL priority class.
HIGH        Start application in the HIGH priority class.
REALTIME    Start application in the REALTIME priority class.
ABOVENORMAL Start application in the ABOVENORMAL priority class.
BELOWNORMAL Start application in the BELOWNORMAL priority class.
NODE        Specifies the preferred Non-Uniform Memory Architecture (NUMA)
            node as a decimal integer.
C:\Users\help.me>start/?
启动单独的窗口以运行指定的程序或命令。
开始[“标题”][/D路径][/I][/MIN][/MAX][/SEPARATE |/SHARED]
[/低/正常/高/实时/高于正常/低于正常]
[/NODE][/AFFINITY][/WAIT][/B]
[命令/程序][参数]
“标题”要显示在窗口标题栏中的标题。
路径开始目录。
B在不创建新窗口的情况下启动应用程序。这个
应用程序已忽略^C处理。除非申请
启用^C处理,^Break是中断的唯一方法
应用程序。
我认为新的环境将是原来的环境通过
指向cmd.exe,而不是当前环境。
最小开始窗口最小化。
最大开始窗口最大化。
在单独的内存空间中单独启动16位Windows程序。
共享内存空间中的共享启动16位Windows程序。
空闲优先级类别中的低启动应用程序。
正常优先级类别中的正常启动应用程序。
高优先级类中的高启动应用程序。
实时优先级类中的实时启动应用程序。
高于正常优先级级别中的高于正常的启动应用程序。
低于正常优先级类中的低于正常启动应用程序。
节点指定首选的非统一内存体系结构(NUMA)
节点作为十进制整数。