I currently have a script to encode files and send them to another machine over the LAN. I've started putting the remote machine to sleep since it isn't being used as much, so I want the batch file to wake the machine if needed.
What I'd like to do is:
1. check to see if the PC is currently on
2. encode the files
3. if PC was already on, send periodic packets to keep it on while the script is running
4. run renamer
5. if machine is off, send a magic packet to wake the machine so they can be copied over
6. if need be, wait for machine to turn on, then check it again
7. copy and move files
That way, the machine won't go to sleep while the script is running only to be woken up again a short time later. Each encoding takes about 40 minutes, and the remote PC sleeps after 1 hour. So, if the machine is currently on, I need a command to keep it alive inserted between each encode.
Here is my current script. It may seem a little weird, but it does what I need. I've trimmed out most of the encoding steps.
set avidemux="D:Programs\avidemux_2.5.6-1_win64\avidemux2_cli.exe" set videocodec= set audiocodec= set curr_dir="D:\New Video" set destination="D:\Encoded Temp\%%f.avi"
set therenamer="C:\Program Files (x86)\theRenamer\theRenamer.exe" set renamer_source="D:\Encoded Temp" set renamer_dest="D:\New TV Episodes"
set copy_dest="D:\Videos" set move_dest="\\DOWNSTAIRS\Video"
chdir video1 set targetsize=300 for %%f in (*.mp4) do %avidemux% --video-codec %videocodec% --audio-codec %audiocodec% --video-conf 2pass=%targetsize% --force-alt-h264 --load "%%f" --save %destination% --quit chdir /D %curr_dir%
chdir video2 set targetsize=375 for %%f in (*.mp4) do %avidemux% --video-codec %videocodec% --audio-codec %audiocodec% --video-conf 2pass=%targetsize% --force-alt-h264 --load "%%f" --save %destination% --quit
Damn right! Lots of people in tech like science topics
as much as I find AI articles long and repetitive and sometimes making it seem super weird…
I would still prefer to have stories and studies in for here…
I'm good, thanks Microsoft. I trust you adding onboard intelligence to my machine about as much as I trust my kid alone in the kitchen with an open bag of cookies. Just please don't.
Question
unknownsoldierX
I currently have a script to encode files and send them to another machine over the LAN. I've started putting the remote machine to sleep since it isn't being used as much, so I want the batch file to wake the machine if needed.
What I'd like to do is:
1. check to see if the PC is currently on
2. encode the files
3. if PC was already on, send periodic packets to keep it on while the script is running
4. run renamer
5. if machine is off, send a magic packet to wake the machine so they can be copied over
6. if need be, wait for machine to turn on, then check it again
7. copy and move files
That way, the machine won't go to sleep while the script is running only to be woken up again a short time later. Each encoding takes about 40 minutes, and the remote PC sleeps after 1 hour. So, if the machine is currently on, I need a command to keep it alive inserted between each encode.
Here is my current script. It may seem a little weird, but it does what I need. I've trimmed out most of the encoding steps.
Link to comment
https://www.neowin.net/forum/topic/1113959-windows-wakonlan-batch-script/Share on other sites
8 answers to this question
Recommended Posts