2017-06-27 5 views
0

Windowsスケジューラを使用して毎分実行するコンソールアプリケーションをセットアップしました。ただし、スケジュールされたタスクが実行されると、CMD画面が一時的にポップアップします。これは厄介なことであり、タスクを最小限に抑えてから閉じることが欲しいです。既存のリソースを見るとスケジュールタスクの実行最小化

は、私が試してみました:

1)「ファイル名を指定して実行は、ユーザーがログオンしているかどうか」:何も起こりません、私は、実行が成功した場合にどうすべきファイル内のエントリが表示されません。

2).exeからショートカットを作成し、ショートカットを最小化します。ショートカットは実際のアプリケーションに変換され、最大化されます。

+0

の可能性のある重複した[隠されたコンソールでC#コンソールアプリケーションを実行する方法](https://stackoverflow.com/questions/836427/how-to-run-ac-sharp-console-application-with -the-console-hidden) –

答えて

1

コンソールアプリケーションをWindows Applicationとしてコンパイルすると、cmdウィンドウがすべて非表示になります。

のVisual Studioを使用している場合は、プロジェクトを右クリック - > [プロパティ - >アプリケーション - >出力タイプ: - >Windowsアプリケーション

+0

気味悪いが、トリックをする:) –

0

を手始めに、あなたならば、コマンドプロンプトでstart /?を実行してみてくださいコンソールアプリを実行しています。それが役立つかどうかを確認するには、/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. 
関連する問題