Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2006
    Location
    Asturias, Spain
    Posts
    82

    Closing multiple processes (1per1)

    Code:
    ------------------------------------------------------------------
    ------------  start closing processes-----------
    -----------------------------------------------------------------
    --read the text file that contains a proccess name per line for ex line 1: Skype.exe so read this and close al processes listed in the file
    -------------------------------------------------------
    
    ch_name = TextFile.ReadToTable("EocScanP.dll");
    
    if (ch_name ~= nil) then
       
       total = Table.Count(ch_name);
       testvar = 1;
    
       while (0 < total) do
       					--------------------------------------------------------------------------------
    					     -----------            cerrar los procesos            --------------
    					-------------------------------------------------------------------------------
    					instances_of_file = 0;
    					file_to_check_for = ch_name[testvar]; --buscara ese archivo
    					processes = System.EnumerateProcesses();
    					
    					for j, file_path in processes do
    					    file = String.SplitPath(file_path);
    					    if (String.Lower(file.Filename..file.Extension)) == file_to_check_for then
    					        System.TerminateProcess(j);
    					    end
    					end
    					-----------------------------------------------------------------------------------
    	
       total = total - 1;
       testvar = testvar + 1;
       end
    
    
    
    
    end
    --------------------------------------------------------------------
    ------------ end closing processes----------------------------
    --------------------------------------------------------------------
    why this code didnt work? i want to read some processes names listed on a textfile and close them all

  2. #2
    Join Date
    Jul 2002
    Location
    Just South of Reality
    Posts
    778
    paul186
    What is the name of the text file you are trying to load into a table? Surely the file name isn't EocScanP.dll. A DLL file is not normally a text file. I'm not familiar with that dll - perhaps it creates the text file you are looking for?
    Last edited by holtgrewe; 03-23-2009 at 12:45 PM. Reason: typo

  3. #3
    Join Date
    Jan 2006
    Location
    Asturias, Spain
    Posts
    82
    Quote Originally Posted by holtgrewe View Post
    paul186
    What is the name of the text file you are trying to load into a table? Surely the file name isn't EocScanP.dll. A DLL file is not normally a text file. I'm not familiar with that dll - perhaps it creates the text file you are looking for?
    yeah it is but i change the extension from txt to dll so lot of people dont try to modify or read it

  4. #4
    Join Date
    Aug 2004
    Location
    Somewhere in Texas, USA
    Posts
    417
    Try this...


    Code:
    Process_Name_List = TextFile.ReadToTable("D:\\Desktop\\EocScanP.dll");
    
    if (Process_Name_List ~= nil) then
    	for e, proccess in Process_Name_List do
    		running_processes = System.EnumerateProcesses();
    		for j, file_path in running_processes do
    			file = String.SplitPath(file_path);
    			if (String.Lower(file.Filename..file.Extension)) == proccess then
    				System.TerminateProcess(j);
    			end
    		end
    	end
    end
    Remember that ALL entries in the EocScanP.dll must be in LOWERCASE only.

Similar Threads

  1. playing Multiple video files in a LOOP
    By Stan Hamers in forum AutoPlay Media Studio 5.0
    Replies: 11
    Last Post: 05-21-2005, 02:14 PM
  2. Playing Multiple Video Files in Sequence
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 09-26-2003, 11:10 AM
  3. Spanning Content Across Multiple CD's
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 09-22-2003, 03:38 PM
  4. HOWTO: Make an Install that Spans Multiple CD-ROMs
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-11-2002, 03:36 PM
  5. Default text in edit field - Multiple edit screen
    By Romahe in forum Setup Factory 6.0
    Replies: 1
    Last Post: 12-18-2001, 01:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts