JCL Help:RegisterAutoExec

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Registers the specified application for execution at logon.


Pascal

 function RegisterAutoExec(ExecKind: TExecKind; const Name: string; const Cmdline: string): Boolean;


Parameters

Parameters Description
ExecKind: TExecKind Specifies how to register the executable. See TExecKind for more information.
const Name: string Name of the registry value to add.
Path The command line of an executable file including command line parameters to register for auto execution.


Return Value

If the function succeeds it returns True, otherwise it returns False. Note that calling RegisterAutoExec with ekServiceRun or ekServiceRunOnce on Windows NT/2000 always causes the function to return False (the file is not registered).


Description

RegisterAutoExec registers the file specified by Path in the system registry so that it will automatically be executed by the system at the next logon. The ExecKind parameter specifies the details about user vs. machine and once vs. always. You can have an application executed once at the next logon (ekMachineRunOnce, ekUserRunOnce) or at each logon (ekMachineRun, ekUserRun). The Machine and User specify for 'all users' or the 'current user only' respectively. Note that except for ekMachineRun and ekMachineRunOnce, all registered executables execute asynchronously. The ekServiceRun and ekServiceRunOnce exist to simulate NT services on Windows 9x and are probably of not much use. You can use the UnregisterAutoExec function to remove the entry for the registry when autoexecution is no longer desired.


See Also

UnregisterAutoExec TExecKind


About

Unit

JclRegistry


Donator

Marcel van Brakel


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page