0

Instead of running PC whole night when computation stops somewhere in middle of night, is there anyway to shut down PC automatically few moments after computation running completes.

user64494
  • 26,149
  • 4
  • 27
  • 56
  • 1
    You can execute a shell command for the OS inside Mathematica using "Run". E.g. on Windows you could say: Run["cmd /C shutdown"] – Daniel Huber Feb 27 '24 at 10:03

1 Answers1

2

suppose your script like this:

Pause[1];
Echo[1];

name it tmp.wls

wolframscript -f tmp.wls  || echo 111 

gives

>> 1
111

then change echo 111 to shutdown

AsukaMinato
  • 9,758
  • 1
  • 14
  • 40