logo elektroda
logo elektroda
X
logo elektroda

Running .bat Scripts as Independent Processes in Windows Console (cmd)

MES Mariusz 5316 1
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 16683891
    MES Mariusz
    Level 36  
    Hey.

    When I run the .bat script, the cmd console launches and the script executes. Nevertheless, in the task manager (ctrl-alt-del, task manager) this script is executed under the cmd.exe process (the cmd.exe process is seen there, after it is stopped the script is terminated).

    I wonder how to run .bat scripts so that they are seen as processes.

    I write scripts for my own needs, controlling for example the computer's working time (it should be turned on at such times and not at other times - at other times the system should shut down immediately). This is just an example, because the functionality is much more.

    The point is, however, that the user (the child has admin rights, but after each system restart the system is restored to the factory settings using Reboot Restore RX) was not able to disable this process (e.g. disable the task tray launched by the task schedule, or disable the process started at startup from the autostart location).

    That's why I want to run 2 processes that control each other, and when one process (while performing other tasks) notices the lack of a second process, it will either restart it or turn off the computer.

    I do it like this:

    process1.bat

    Code: Bash
    Log in, to see the code



    process2.bat

    Code: Bash
    Log in, to see the code


    The problem is that both processes cannot check, because in the manager they are two separate processes but named cmd.exe.

    Hint request.

    Thank you and best regards
    Mariusz
  • ADVERTISEMENT
  • #2 16685301
    clubs
    Level 38  
    Hello

    Add a window name

    Code: Dos
    Log in, to see the code


    and then
    Code: Dos
    Log in, to see the code
ADVERTISEMENT