Post Setup commands don't work

I have 4 commands to run after the initial setup, they are basic power setting commands and 1 command to disable system defrag. I have attached my preset. I have tested all 4 commands on my current computer and they all work as intended. Below are the 4 commands I am trying to run.

powercfg -setacvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e 0012ee47-9041-4b5d-9b77-535fba8b1442 6738e2c4-e8a5-4a42-b16a-e040e769756e 0

powercfg -setacvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 0

powercfg /SETACVALUEINDEX SCHEME_CURRENT 7516b95f-f776-4464-8c53-06167f40cc99 3c0bc021-c8a8-4e07-a973-6b14cbcb2b7e 0

schtasks /Change /TN \Microsoft\Windows\Defrag\ScheduledDefrag /DISABLE
 
Hi,
since these commands are a bit obscure (the powercfg ones), how do I confirm visually one of them that it worked?
Tried now your preset and checked Defrag task, was disabled. For the sake of transparency used it live, not offline due to time constraints.
Did you check the Defrag task?
If using an OEM product key, make sure to enable OEM SetupComplete on the Unattended page toolbar.

Btw you don't need all the cumulative updates except the latest one (KB4103727 at this moment), it contains all. Same for Servicing Stack.
Or even switch to 1803 Windows, don't see the point in staying with 1709 unless you have one of those SSDs having BSODs.
 
Some Power options in Power Settings are hidden by default and there are loads of power settings in the registry with lots of duplicates.
 
Hi,
since these commands are a bit obscure (the powercfg ones), how do I confirm visually one of them that it worked?
Tried now your preset and checked Defrag task, was disabled. For the sake of transparency used it live, not offline due to time constraints.
Did you check the Defrag task?
If using an OEM product key, make sure to enable OEM SetupComplete on the Unattended page toolbar.

Btw you don't need all the cumulative updates except the latest one (KB4103727 at this moment), it contains all. Same for Servicing Stack.
Or even switch to 1803 Windows, don't see the point in staying with 1709 unless you have one of those SSDs having BSODs.

I plan on making a boot disc with 1803 but I was trying to iron out these commands and issues first.
The first 3 commands are power management changes that can be checked by going to "Settings" - "Power & Sleep" - "Additional Plan Settings" - "Change Plan Settings".

The first command sets the hard disk timeout to "0".
The first second makes it so that my laptop doesn't go to sleep when I close the lid when connected to a power source.
The third command sets my monitor timeout to "0".

All these commands can be visually confirmed in the "Change Plan Settings" window.
 
I am not familiar with encapsulating commands. So would it look like this then? cmd /c “powercfg -setacvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 0”
 
So would it look like this then? cmd /c “powercfg -setacvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 0”

Yes, I use a lot in my video encoding gui, you can write without quote, like:
Code:
cmd /c powercfg -setacvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 0

or long command, use quote to encapsulate spaces like file name, or pipe
Code:
cmd /c ffmpeg -hide_banner -v error -strict -1 -i "my video.mp4" -map 0:1 -f yuv4mpegpipe -pix_fmt yuv444p10le -r 23.976 -s 1280x720 - | x265 -i - --y4m --preset medium raw.h265

cmd will treat /c as like console input, where we usually type
 
Ok thank you very much I will try that this weekend and see if it works. What about the last command to disable disk defrag?+
schtasks /Change /TN \Microsoft\Windows\Defrag\ScheduledDefrag /DISABLE
 
Ok thank you very much I will try that this weekend and see if it works. What about the last command to disable disk defrag?+
schtasks /Change /TN \Microsoft\Windows\Defrag\ScheduledDefrag /DISABLE

I use this, disable Disk Defrag via Windows Service,
Code:
sc config defragsvc start= disabled

what I do in NTLite
Code:
cmd /c sc config defragsvc start= disabled

take note that "start= disabled" have space, it will pass 2 argument, dont add quote :)
 
I tried the commands using the encapsulated version you suggested by putting cmd /c in front of my commands and they unfortunately did not work.

Perhaps I am not entering them correctly in the post set up tab. Under “execution queue” I type cmd, then under “parameters” I typed /c powercfg -setacvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 0

I created a batch script with my original commands, when I click on it after a fresh install the batch script applies all 4 commands successfully. Would just adding the batch script to the post setup potentially work? If so, what would I put in the “parameters”’column to run the batch script?
 
Back
Top