How to show console of hidden (background) task in Windows?

7,161

Solution 1

Solution:

I have decided to write small open-source software for that.

Software that let you connect to any other console program, and control it (see the console, and send commands)

How is it working?

In the task manager you run using the remote-console

remote-console --server [port] cmd.exe

Then, to see the console you need to connect to it:

remote-console --client [ip] [port]

You just need to install it oce using npm

npm i -g node-remote-console

pull requests are welcome :)

https://github.com/AminaG/node-remote-console

Solution 2

If you start your task under specified account, option "Run when user is logged on or not", the task can't interact with desktop at all.

The option "Run only when user is logged on" does the trick, but it shows console always.

My personal solution - run console scripts in ConEmu it may start it taskbar status area and may be easily reveal from. Example below starts script in ConEmu in certain directory, waits for script finishes and closes the window.

Program:
  c:\tools\ConEmu\ConEmu64.exe
Add arguments:
  -basic -StartTSA -dir c:\Sources -cmd cmd.exe /c c:\Sources\Maintain.cmd -cur_console:n

Some comments

  • -basic forces some default ConEmu settings without interaction with user on first start.
  • The part after -cmd is the command itself: cmd.exe /c c:\Sources\Maintain.cmd.
  • -cur_console:n permits automatic window shutdown if script finishes promptly. Must be last switch.
Share:
7,161

Related videos on Youtube

Aminadav Glickshtein
Author by

Aminadav Glickshtein

Started coding at the age of seven, with the ability to program as if it were a native language. Has in-depth knowledge of software development, cloud, big data, web, desktop, cybersecurity, blockchain, DevOps and mobile development. Latest innovation: Control V

Updated on September 18, 2022

Comments

  • Aminadav Glickshtein
    Aminadav Glickshtein over 1 year

    I am using task scheduler. I am runing many console software on Startup. The console software works great in the background. Sometimes I want to see the "CONSOLE" of those software.

    Is there any way to see the console/window of background process?