Hello guicanarin,
You can execute scripts in headless mode, but it requires installed and activated PhotoScan Pro, as the functionality is not provided as stand-alone library or SDK.
To call the script from the command-line you can use the following:
photoscan.exe -r script.py [arguments]