Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

CLI Task from the Windows command line


Go to End


2 Posts   1099 Views

Avatar
ccburns

Community Member, 79 Posts

31 July 2016 at 4:56am

Hi All,

I am managing a Windows server but sadly I don't have much experience with windows (or sys admin in general). I know enough to make myself dangerous :)

I've set up CLI tasks plenty of times on Linux boxes and have then scheduled via CRON.

I'm trying to do the same on this windows machine but it just doesn't seem to be playing fairly :)

My main issue is how to execute the CLI Task from the command line.

"C:\Program Files (x86)\PHP\v5.4\php.exe" C:\inetpub\wwwroot\invitro.multisite\framework\cli-script.php UpdateSearchIndexTask data_area_id=ivtnz

Unfortunately with this I get an error message saying that that Line 1 Character 43 is an unexpected token.

If I leave out the double quotes then I get an error message about the (x86) bit of the code.
If I sound everything in double or single quotes it just seems to print out the command to the screen and doesn't execute anything.

There is no information on the page below for how to call a CLI Task from the windows command line.
https://docs.silverstripe.org/en/3.4/developer_guides/cli/

Any help is appreciated.

Thanks,
Colin

Avatar
ccburns

Community Member, 79 Posts

8 February 2017 at 3:49pm

Just a note: The command is correct. The problem is that I was running it from the Powershell not the Command Prompt (yep Windows noob).

Cheers