Post-install setup commands don't run

laywee

New Member
Hello, I can't figure out how the post-installation section works. What is the difference between the two sections in it? I tried adding three commands to both, but they don't run after installation. How do I get them to run?

here are the commands:

powercfg -setactive “C:\Users\Default\Desktop\Post_install\sup\powerplan.pow"

schtasks / Change / DISABLE / TN " Microsoft Windows Defrag ScheduledDefrag"

shutdown /r /t 10 /c "Restart to apply settings"
 
You're probably not separating Command (left column) from Parameters (yellow column).
No spaces after the "/", -> "/Change"

CommandParameters
powercfg-setactive “C:\Users\Default\Desktop\Post_install\sup\powerplan.pow"
schtasks/Change /DISABLE /TN " Microsoft Windows Defrag ScheduledDefrag"
shutdown/r /t 10 /c "Restart to apply settings"
 
Last point, if you invoke a shutdown, make sure it's the final command because Windows won't continue running any further commands.
 
Thank you very much, indeed, I wrote everything in one column (parameters).
КомандаПараметры
powercfg-setactive «C:\Users\Default\Desktop\Post_install\sup\powerplan.pow»
задачи/Изменить /ОТКЛЮЧИТЬ /TN «Дефрагментация Microsoft Windows ScheduledDefrag»
неисправность/r /t 10 /c «Перезагрузить, чтобы применить настройки»
 
Last edited:
И последнее: если вы вызываете завершение работы, убедитесь, что это последняя команда, поскольку Windows не будет продолжать выполнять какие-либо дальнейшие команды.
They are still not starting. I can't figure out why. :(
 

Attachments

  • image.png
    image.png
    34.2 KB
Last edited:
All your commands have the wrong arguments, except for shutdown.
Code:
powercfg /import C:\path\to\folder\my_plan.pow
powercfg /setactive 81b4222-f694-41f0-9685-ff5bb260df2e

schtasks /Change /DISABLE /TN "\Microsoft\Windows\Defrag\ScheduledDefrag"

If you're using the power plan for one time only, then Add the plan file as a File in Post-Setup.
NTLite will copy it to a temporary "%WINDIR%\Setup\Files" local folder. After Post-Setup, the temporary folder is removed.

Capture.PNG
 
All your commands have the wrong arguments, except for shutdown.
Code:
powercfg /import C:\path\to\folder\my_plan.pow
powercfg /setactive 81b4222-f694-41f0-9685-ff5bb260df2e

schtasks /Change /DISABLE /TN "\Microsoft\Windows\Defrag\ScheduledDefrag"

If you're using the power plan for one time only, then Add the plan file as a File in Post-Setup.
NTLite will copy it to a temporary "%WINDIR%\Setup\Files" local folder. After Post-Setup, the temporary folder is removed.

View attachment 11135
Thank you, it helped me a lot, all the commands work, except for the reboot. I need a reboot to take place after the first login after 30 seconds, but this happens at the moment of preparing windows, and not after the initial desktop boot, although I added the command to the user section.1705158622939.png
 
Last edited:
I also can't figure out how to correctly register /set active. The GUID is always different. How do I install the circuit immediately after installation? It is imported, but not installed, since the GUID is always different.
 
Before exporting your power plan, run "powercfg /list" to find all the GUID's. If you cloned a new plan, it will have a random GUID.
Code:
C:\Windows\System32>powercfg /list

Existing Power Schemes (* Active)
-----------------------------------
Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e  (Balanced) *
Power Scheme GUID: 86798a0e-df51-4344-b172-8a7756846337  (My Power Plan)
Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c  (High performance)
Power Scheme GUID: a1841308-3541-4fab-bc81-f71556f20b4a  (Power saver)

Scheduling a reboot in Post-Setup (User) is tricky, because you can't guarantee the timing. The logon task doesn't run exactly at the same time (sometimes a little early, sometimes later).

Why do you need a restart? None of these commands require a restart to take effect.
 
Before exporting your power plan, run "powercfg /list" to find all the GUID's. If you cloned a new plan, it will have a random GUID.
Code:
C:\Windows\System32>powercfg /list

Existing Power Schemes (* Active)
-----------------------------------
Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e  (Balanced) *
Power Scheme GUID: 86798a0e-df51-4344-b172-8a7756846337  (My Power Plan)
Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c  (High performance)
Power Scheme GUID: a1841308-3541-4fab-bc81-f71556f20b4a  (Power saver)

Scheduling a reboot in Post-Setup (User) is tricky, because you can't guarantee the timing. The logon task doesn't run exactly at the same time (sometimes a little early, sometimes later).

Why do you need a restart? None of these commands require a restart to take effect.
let's say I don't need a restart, but here's how to make my default power scheme?
 
Of course, then I'll come up with workarounds myself. Thank you very much for your help. =)
I found a solution: you just need to specify the GUID immediately when importing.
for example:

powercfg /import c:\users\default\desktop\powerplan.pow ee7b605a-40ea-4080-9ffa-9reb2a6c843b
powercfg /setactive ee7b605a-40ea-4080-9ffa-9reb2a6c843b
 
Back
Top