Search code examples
formsoracle-databasehosttaskkill

Killing inactive form session through oracle application server


I am trying use host command in Oracle forms. I get the process id as input from the user and on clicking ok the form should kill the session related to process id.

PS: Users will be entering only frmweb.exe process id which are inactive.

cmd := 'CMD /C taskkill /F /FI /pid 'process which is got as input' /IM frmweb.exe';
host(cmd)

I also tried by writing the above command into a .bat file in application server.When trying to execute the bat file it din work. But when tryin to run the bat file by double clicking in Application server the session was killed.

  1. On executing the above I am unable to kill the process.
  2. I would also like to know whether the host command was successful or not.

Could you please help me and guide me in proceeding. Orakill and alter session are working but I don want to use it.


Solution

  • I tried with writing the command execution to a text for debugging and was able to find the solution.

    cmd := 'CMD /C taskkill /F /FI /pid 'process which is got as input' /IM frmweb.exe>>output.txt';
    

    There was some special character written in at the end of the command due to which the command was failing when calling from Oracle Forms.Special character was due to a typo in the code the Oracle Forms.