2017-06-27 2 views
0

J'ai configuré une application de console pour exécuter chaque minute à l'aide du planificateur Windows. Toutefois, un écran CMD s'affiche brièvement lorsque la tâche planifiée s'exécute. C'est un peu ennuyeux et j'aimerais que la tâche démarre tout en étant minimisée puis fermée.Exécution de tâche planifiée réduite

Vous cherchez les ressources existantes, j'ai essayé:

1) « Exécuter si l'utilisateur est connecté ou non »: rien ne se passe, je ne vois aucune entrée dans le fichier qui devrait se produire si l'exécution a réussi .

2) Créer un raccourci dans le .exe et faire fonctionner le raccourci réduit: Le raccourci est converti en application réelle et il fonctionne au maximum.

+0

double possible de [Comment exécuter une application console C# avec la console cachée] (https://stackoverflow.com/questions/836427/how-to-run-ac-sharp-console-application-with -la-console-cachée) –

Répondre

1

Si vous compilez l'application de console en tant que Windows Application, la fenêtre cmd sera masquée.

Si vous utilisez Visual Studio, cliquez droit sur le projet ->Propriétés ->application ->Type de sortie: ->Application Windows

+0

Cheeky, mais fait le tour :) –

0

Pour commencer essayer d'exécuter start /? dans l'invite de commande si vous exécutez une application de console. Essayez l'option /min pour voir si cela aide.

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.