gfody / onshutdown Goto Github PK
View Code? Open in Web Editor NEWReliably execute commands pre-shutdown delaying shutdown if necessary.
License: The Unlicense
Reliably execute commands pre-shutdown delaying shutdown if necessary.
License: The Unlicense
Hi @gfody
We search exactly something like your service "OnShutdown", but unfortunately we are not able that your service works on Windows Server 2016 & 2019 VMs (Hyper-V).
I registered the Windows service like:
New-Service OnShutDown -bin 'OnShutdown 4000 "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command {Get-process | out-file c:\temp\testfile.txt}"' -StartupType Automatic
Do you have any idea why this is not working?
I am on Windows 11 Home, and I am looking for a way to perform some registry changes (stored in a *.reg file) whenever I shut down the laptop. Even with the info I found online - also in your instructions, and in the two existing issue threads - I just couldn't manage to make it work.
Maybe this would also be helpful to others. Could you run me through the necessary steps? Thanks! : )
Here's what I tried:
New-Service OnShutdown -bin 'OnShutdown 1 "cd \"C:\Program Files (x86)\Pulse-Eight\USB-CEC Adapter\" && tv_off.cmd"' -start Automatic
This doesn't seem to work on shutdown. Confirmed that service is started.
The README says The second parameter is the command to pass through to CreateProcess
so I assume there's something wrong with my string. Running the string by itself unescaped works properly.
I have a batch file "C:\somebatch.bat".
I didn´t manage to get the right syntax for registering the OnShutdown Service to execute this file on shutdown.
Could you please help me?
Best regards,
P.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.