Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.

End Windows processes from within Silk Performer

End Windows processes from within Silk Performer

It is possible to terminate a Windows process using a batch file, and calling that batch file from within Silk Performer. The following code demonstrates this process using the Windows command line utility tasklill.exe.

The contents of the batch file is as follows:

cd c:\windows\system32 taskkill /IM acrord32.exe /f

This file is then saved into Silk Performer as a data file and executed using the ProcessInitialize function.

// Create process and start it up...

hProcessId := ProcessInitialize("command.bat", PROCESS_DETACHED,"", "c:\\", "c:\\out.txt");

// Wait for process to finish.


// Kill the process if it hasn't finished yet - this is referring to the cmd line tool
nStatus := ProcessGetState(hProcessId);
if (nStatus <> PROCESS_STATE_FINISHED) then
ProcessKill(hProcessId, PROCESS_KILLSINGLE);
// Read the output of the process, written to a file
FOpen(hFile, "c:\\out.txt", OPT_FILE_ACCESS_READ, OPT_FILE_OPEN);
while FRead(hFile, sData, 1, nRead) do

Note: Windows Vista and up may require elevation of privileges for this command to work.


Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-04-08 09:35
Updated by:
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.