I have the method stored in Z:\work\project\apps\controllers\_cron\tools\method
How can I call "method" using the command line?
You run the PHP executable with the location of the file as an argument (Windows example: php.exe path/to/method.php). The location of php.exe depends on where you installed it.
Easy as
C:\path\to\php.exe -f "Z:\path\to\file.php"
Source: #1 result for "run php from command line windows" in google
methodliterally as in method of a class, you will need a script that calls this method and then run this script from CLI.-r "include(...); my_method();"or similar.