Page 1 of 1

Restart Computer.

Posted: Fri Feb 05, 2021 9:18 am
by Googie85
Hi Guys!!!!!

I am trying to restart my computer with the following console command: "shutdown /r". How would I go about achieving this?

Many Thanks,

Googie.

Re: Restart Computer.

Posted: Fri Feb 05, 2021 10:29 am
by mrcoollion
You can use the Shell Command.
https://livecode.fandom.com/wiki/Shell

Or see LC dictionary

Regards,

Paul

Re: Restart Computer.

Posted: Fri Feb 05, 2021 10:32 am
by bogs
I'm not sure I understand the question, Googie.

It would be nice to know which OS your using as well, but what do you see when you open the CLI and type in "shutdown /r" ?

Re: Restart Computer.

Posted: Fri Feb 05, 2021 11:26 am
by mrcoollion
I assumed it is a windows OS because shutdown /r is a typical Windows console command for restarting your PC.
And being on the LiveCode forum I also assumed it needed to be done within a LC Stack.

Probably not to smart of me as assumptions can make an ........
:D :shock:

Re: Restart Computer.

Posted: Fri Feb 05, 2021 11:59 am
by bogs
My initial thoughts as well Paul, however, shutdown works across all 3 desktop OS'es, so it would be nice to know which is being worked with for testing, since the various D'OS'es can vary in how shell works.

I've made an ........... of myself plenty, I wouldn't sweat it too much heh heh.

*Edit - since we're in the 'Windows' section, I think I just did again hahah.

Re: Restart Computer.

Posted: Fri Feb 05, 2021 12:22 pm
by Klaus
As Paul already mentioned, use SHELL:

Code: Select all

...
put shell("shutdown /r") into tDummy
...