on every peripheral insert (CD. Flash drive. external hdd. phone. memory card) the binary must execute a commands like :
xcopy "d:/" "c:/backuped/name-datetime"
xcopy "e:/" "c ....
xcopy "f:/" ....
and so on
Why are you using command-line apps to accomplish this, instead of using platform APIs directly in your code? Look at the Win32 GetLogicalDriveStrings(), CopyFile(), SHFileOperation(), and IFileOperation APIs.
basically it will work with TProcess but i have no hint how to set the launch on system startup and the run on peripherics insert
For system startup, place a link to your app in one of the following Registry keys:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
Or, place a shortcut to your app in the "Startup" folder of the user's Start Menu.
Or, design your project to run as a background service instead of an app, and set the service's start type to auto-start.
Either way, to detect when peripherals are inserted, you need to leave your program running and have it call the Win32 RegisterDeviceNotification() API to ask Windows to send WM_DEVICECHANGE messages to your app whenever devices are added to, or removed from, the system.