I plan to run specific application commands every X days using Task Scheduler. Do I have to write support for command-line parameters first, so Scheduler can execute it?
If so, does anyone know any good command-parameter components?
If you just want to read any cmd line parameters that were passed to your application at start-up you can use Delphi's inbuild functions.
ParamCount // Number of cmd params passed at startup
ParamStr(0) // string of param zero
So calling you program like so
c:\myapp.exe -foo -bar
would give the following result
ParamStr(0) = c:\myapp.exe
ParamStr(1) = -foo
ParamStr(2) = -bar
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With