User Tools

Site Tools


windows_dos

This is an old revision of the document!


Windows/DOS

Kill processes by image name

Have a runaway process with hundreds or thousands of programs (eg: cmd.exe) all running and need to kill them all in one go?

0@@

How to force logoff a session on another server

Method 1 with the TSM GUI

  • Launch Terminal Services Manager (in Administrative Tools)
  • In the menu: Actions “Connect to Computer…”
  • Enter name of server you want to get on to
  • Right-click and logoff one of the displayed sessions

Method 2 with Command prompt

  • Launch Windows (DOS) box
  • Enter “query session /server:<servername>”
  • Enter “logoff <ID> /server:<servername>”

Return the value of a function into a variable in DOS batch .bat file

What an awful language!

1@@

Create a Scheduled Task from the command line

This one is particularly interesting as I need to start a shell Cygwin shell script on a regular basis<br /> As crontab is not implemented by default, I use the Windows Scheduler to start the jobs.<br /> This one creates a task called dbamon_dblist tat runs a shell every 10 minutes starting at 9 am and going on for 24 hours (so, forever).<br /> It is run a user different from the logged on user. The echo at the start is to answer N to the question “Task exists, do you want to replace it”. For some reason that doesnt work too well :(

2@@

Scheduled Task seems to do nothing. Runs but stops immediately

  • Check task scheduler log

Advanced:View log …

3@@
  • Check error code given
4@@

Not very helpful on the part of Microsoft but the 80 error turned out to be a whole load of sqlplus.exe processes (100's) hanging around in the task manager<br /> Killed them and jobs started running again.

windows_dos.1544130327.txt.gz · Last modified: 2018/12/06 21:05 by 91.177.234.129

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki