0
votes

I have setup a console app to run every minute using Windows scheduler. However, a CMD screen pops-up briefly when the scheduled task runs. This is kind of annoying and I would like the task to start up while minimized and then close.

Looking into existing resources, I have tried:

1) "Run whether user is logged on or not": nothing happens, I do not see any entry in the file which should happen if the execution was successful.

2) Create a Shortcut from the .exe and make the shortcut run minimized: The shortcut is converted to actual app and it runs maximized.

2

2 Answers

1
votes

If you compile the Console Application as a Windows Application it'll hide the cmd window all together.

If using Visual Studio, right click the project -> Properties -> Application -> Output type: -> Windows Application

0
votes

For starters try running start /? in command prompt if you are running a console app. Try /min option to see if it helps.

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.