Git Product home page Git Product logo

Comments (2)

t4ce avatar t4ce commented on May 30, 2024

install script for start + run service (powershell)
on 64bit amd windows 11, put this into a bat file, have nssm and sol in the same folder

call nssm.exe install SleepOnLan sol.exe
call powershell -Command "& {Start-Service 'SleepOnLan';}"

protip: execute the sol.exe once manually to add firewall

i just want to add this here cause it will help some users but
to be honest it is not a reply to Arnasnn's Question, but his question is unreleated anyway. please delete.

from sleep-on-lan.

sergeolkhovik avatar sergeolkhovik commented on May 30, 2024

I have similar thing:

  "Commands" : [{
     "Operation" : "sleep",
     "Command" : "c:\\bin\\psshutdown.exe -d -t 3 -v 0",
     "Default" : true
   }, {
     "Operation" : "killgames",
     "Command" : "cmd.exe /c d:\\home\\Serge\\bin\\vanya-killgames-do.cmd",
     "Default" : false
   }]

Sleep works OK, but games killer doesn't. CURL output:

<?xml version="1.0" encoding="UTF-8"?>
<result>
  <operation>killgames</operation>
  <successful>true</successful>
</result>% 

and the log:

2022-07-03 14:09:30 INFO  listener_http.go:221 Executing [killgames]
2022-07-03 14:09:30 INFO  sleeper_windows.go:35 Executing operation [killgames], type[external], command [cmd.exe /c d:\home\Serge\bin\vanya-killgames-do.cmd]
2022-07-03 14:09:30 INFO  sleeper_windows.go:46 Sleep implementation [windows], sleep command is [%!(EXTRA string=cmd.exe /c d:\home\Serge\bin\vanya-killgames-do.cmd, string=])
2022-07-03 14:09:30 ERROR  sleeper_windows.go:49 Can't execute command [cmd.exe /c d:\home\Serge\bin\vanya-killgames-do.cmd] : exit status 1

Doesn't matter if I fun simply my cmd file as a command or via cmd.exe /c...
Looks like it works if full path is specified (C:Windows\System32\cmd.exe):

⇨ http server started on [::]:8009
2022-07-03 14:20:19 INFO  listener_http.go:221 Executing [killgames]
2022-07-03 14:20:19 INFO  sleeper_windows.go:35 Executing operation [killgames], type[external], command [C:\Windows\System32\cmd.exe /c d:\home\Serge\bin\vanya-killgames.cmd]
2022-07-03 14:20:19 INFO  sleeper_windows.go:46 Sleep implementation [windows], sleep command is [%!(EXTRA string=C:\Windows\System32\cmd.exe /c d:\home\Serge\bin\vanya-killgames.cmd, string=])
2022-07-03 14:20:20 INFO  sleeper_windows.go:51 Command correctly executed

(and I added full path to taskkill inside my cmd script as well).

from sleep-on-lan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.