0

I can schedule a .bat script to be executed on system start up in Windows Server using Scheduled tasks in control panel and specify a user to perform this execution on behalf of.

But when this script starts and runs other programs they all are invisible for me even when i log into the system. I see them in task manager and there is only one user session established.

They question is, whether there is a way to make these consoles and applications visible, so I can see execution process and stop it if required?

sviklim
  • 1,054
  • 1
  • 15
  • 30

3 Answers3

1

As long as your user has administrator privileges, this is quite simple: There is a button on the left bottom side of taskmanager where you can "show processes from all users"

I am doing this everyday...

If you are interested in the output of stdout from each program, you have to pipe it into a textfile/logfile.

for creating and writing to a new logfile use:

program.exe > logfile.txt

for appending to a existing one use:

program.exe >> logfile.txt

Use a logfile roller like tail (http://tailforwin32.sourceforge.net/) to watch these logfiles while the programs are executed.

Beside of that, I don't think, that it is possible to get UI Outputs from another user onto your screen without logging in as this user. But if you are really logged in on the same user session, I think program UIs should pop-up when a script executes the program.

Jürgen Zornig
  • 1,174
  • 20
  • 48
  • thanks, Jürgen; actually there is already logger in the application, the case here was to provide ability to see latest messages on the screen; but it seems to me, that only apps executed inside the existing explorer session can have output on the screen; if the app is started before (via scheduled tasks or using autologon from sysinternals) it will be only visible inside process explorer or task manager, but there will be no windows or icons in notification area – sviklim Feb 22 '13 at 00:37
  • mhm...seems to depend on the chronological order of task firing and logon. In another application we also fire up a batch script every hour to send some data out of a simple access database. When I am working on this terminal it is often disturbing, when the access database screen comes up every hour an I have to refocous on my work. We do this with task sheduler. So I wonder that the only problem is System startup. Another possibility is to start it by windows autostart, which you can configure in the registry key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run – Jürgen Zornig Feb 22 '13 at 13:45
1

In the Task Scheduler when you select the task you created to run at system startup, the Actions pane on the right has an 'End' action under the Selected Items menu which you can use to stop the process (as an alternative to killing it with Task Manager). As Jurgen explained in his answer, there doesn't appear to be any way to actually see the current process output on a console window like you'd expect when running the script from Windows Explorer.

jinxcat2008
  • 703
  • 7
  • 12
0

in the end of your batch file you can put a

  pause

This will require input from the user to continue. Or if you want you can put it between statements.

You can also do @echo and convey messages to the end user.

apollosoftware.org
  • 12,161
  • 4
  • 48
  • 69