hey can you guys help me out i,m working on a project
here it goes :
do you know how to make a program that will run silently and will monitor is two processes are running or not
if process a is running than it will launch process b
but if pocess a exits than it kills process a
i,ll call the program
monitor.exe
it does
if notepad.exe is running
then run notepadhelper.exe
if notepad.exe terminates
then terminate notepadhelper.exe
the program has no taskbar icon or options
i would really really be thankfull if someone would be kind enough to show me what the code would look like ,i realy need this
RUN program that monitors if process exit
Started by
rockeveryone21
, Aug 13 2008 04:21 PM
11 replies to this topic
#1
-
Posted 13 August 2008 - 04:21 PM
Instead of polling for active processes, you could achieve something similar with the RunWait command:
run, notepadhelper.exe runwait, notepad.exe process, close, notepadhelper.exe
#2
-
Posted 13 August 2008 - 04:36 PM
"Anything worth doing is worth doing slowly." - Mae West
#NoTrayIcon Process, Wait, notepad.exe Run, Path\NotePadHelper.exe Process, WaitClose, notepad.exe Process, Close, notepadhelper.exe
Change the names to suit your needs. I doubt notepadhelper is right.
#3
-
Posted 13 August 2008 - 04:38 PM
Below is some timer code that I have that checks for a RDP or Citrix connection.
If a RDP or Citrix connection is detected, it kills AutoHotkey.exe. If no connection, then it starts AutoHotkey.exe.
You might be able to adapt it to suit your needs.
If a RDP or Citrix connection is detected, it kills AutoHotkey.exe. If no connection, then it starts AutoHotkey.exe.
;############# Below is the auto-executing & persistent code ###################################### #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.Avoids checking empty variables to see if they are environment variables. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. #persistent #SingleInstance force SetTitleMatchMode, 2 #MaxMem 2 #InstallKeybdHook #NoTrayIcon DetectHiddenWindows On ; do initial sleep on start up to allow normal autohotkey startup at operator logon Sleep, 20000 ;############# Set timer for Process checker ###################################################### SetTimer, processchecker, 100 ; Disable the right click menu for tray icon so IDT operators cannot close the AHK programme { Menu, Tray, NoStandard Menu, Tray, DeleteAll } ;############# below is the timer for Process checker ############################################ processchecker: Process, Exist, wfica32.exe ; check to see if Citrix Client (wfica32.exe) is running. If running, kill AutoHotkey.exe on the host PC as it interferes with CITRIX citrix_pid=%errorLevel% ; errorlevel equals the PID if active Process, Exist, mstsc.exe ; check to see if Microsoft (mstsc.exe) is running. If running, kill AutoHotkey.exe on the host PC remotedesktop_pid=%errorLevel% ; errorlevel equals the PID if active If (citrix_pid + remotedesktop_pid = 0) { ; neither client is present so check for AutoHotkey.exe Process, Exist, AutoHotkey.exe ; check to see if AutoHotkey.exe is running { If ! errorLevel { Run,%A_ProgramFiles%\AutoHotkey\AutoHotkey.exe Return } else { Return } } } else ; one or more client is present so close AutoHotkey.exe { Process, Close, AutoHotkey.exe Return } Return
You might be able to adapt it to suit your needs.
#4
-
Posted 14 August 2008 - 10:52 AM
Paul O
thanks mate for all your help everyone who posted
i have another question
can you tell me the syntax to do this:
copy cowscanfly.txt from c:\dogs
to c:\cows
rename cowscanfly.txt in c:\cows to cowscansing.exe
Process, WaitClose, notepad.exe
Process, Close, cowscansing.exe
delete cowscansing.exe
i have another question
can you tell me the syntax to do this:
copy cowscanfly.txt from c:\dogs
to c:\cows
rename cowscanfly.txt in c:\cows to cowscansing.exe
Process, WaitClose, notepad.exe
Process, Close, cowscansing.exe
delete cowscansing.exe
#5
-
Posted 14 August 2008 - 01:24 PM
See FileCopy, FileDelete, and FileMove for renaming and moving files.
#6
-
Posted 14 August 2008 - 01:30 PM
"Anything worth doing is worth doing slowly." - Mae West
Just curious, what do you plan to do with this?
Just sitting back and looking, it seems almost like the right strategy for a Keylogger to attach (Silently) to a program, record info, and hide its evidence...
Not that you'd be thinking that... :shock:
Just sitting back and looking, it seems almost like the right strategy for a Keylogger to attach (Silently) to a program, record info, and hide its evidence...
Not that you'd be thinking that... :shock:
#7
-
Posted 14 August 2008 - 02:06 PM
no nah its nothing of that sought i,m making it as a protection system form my program see i,ll create a main exe and rename it to something else and put in dummy files in the same directory etc etc if youll search all my posts are related so no probs i,m a good man
i,m just having problem reading and understanding the text eventually ill get through but i have so little time to do stuff
i,m just having problem reading and understanding the text eventually ill get through but i have so little time to do stuff
#8
-
Posted 14 August 2008 - 02:31 PM
hey how do you make a dependency example
lets say i make a program named tuna.exe i want it to have a dependency if the dependency is not found the tuna exe does not run
if cows.exe exists than
lets say i make a program named tuna.exe i want it to have a dependency if the dependency is not found the tuna exe does not run
if cows.exe exists than
#9
-
Posted 19 August 2008 - 01:16 PM
You mean to check if a file exists, and if not, don't run?
#10
-
Posted 19 August 2008 - 01:52 PM
yes if a process exits than contineu running but if it doesnt than dont run
#11
-
Posted 19 August 2008 - 02:10 PM
#12
-
Posted 19 August 2008 - 02:46 PM