I am using raspberry Pi as a webcam server in my windows PC. It is working fine and I am able to use my raspberry Pi camera in Skype, Google meet etc but one thing that I want to improve is simultaneously stopping it or shutting down my Pi when I shut down my Windows PC. I even made a shell script and under Window Settings Scripts(Startup/Shutdown) I added the script inside shutdown but still it didnt work. Although strange thing is that, the command got executed as the below lines
this is in the first line this is in the second line
got printed in a text file xy.txt inside this folder
This is my script
@echo off start "C:\Program Files\PuTTY" plink.exe -no-antispoof -ssh email@example.com -pw mypassword sudo shutdown now (echo this is in the first line) > xy.txt (echo this is in the second line) >> xy.txt exit
Is there any other elegant way to get this done.