Compact option has no effect in resulting ISO

NoTRite

Member
Hey nuhi

I noticed if you set "Compact" to "true" in NTLite, it doesn't work.

To replicate error:

load image, go to
Code:
Automate > Unattended > WindowsPE (Setup option) > Windows setup options > Install > Operating system > Compact
then set to "true"

After installation, open CMD/Powershell, and run

Code:
compact.exe /CompactOS:query

Expected behaviour:

The command should return

The system is in the Compact state. It will remain in this state unless an administrator changes it.

Actual behaviour:

The command returns

The system is not in the Compact state because Windows has determined that, it is not beneficial for this system.
 
I just tested it and it works fine, also autounattend.xml entry is well formed, so whatever is happening, it's probably Windows choosing so or something else.

Did you try manually to compact that same OS, does it deny it or works when executed explicitely:
Code:
compact /compactos:always

If that works, did you use NTLite generated autounattend.xml file, maybe it wasn't deployed?

If your unattended for some reason doesn't do it automatically, maybe the Windows partition when over some size limit, then add the compact command to the Post-setup page, that will work.

I did retest on the same machine without the entry, and query returns:
"The system is not in the Compact state but may become compact as needed."
So I guess the post-setup command is necessary for big drives, while smaller partitions (don't know the exact limit), can be compacted using the existing unattended option.
I'll think about adding it in both places regardless to make sure it sticks. Once you add it to the post-setup it will stick in your preset (Add Command: "compact", Parameters: "/compactos:always") - without quotes.

Let me know how it goes.
Thanks.
 
Last edited:
I just tested it and it works fine, also autounattend.xml entry is well formed, so whatever is happening, it's probably Windows choosing so or something else.

Did you try manually to compact that same OS, does it deny it or works when executed explicitely:
Code:
compact /compactos:always

If that works, did you use NTLite generated autounattend.xml file, maybe it wasn't deployed?

If your unattended for some reason doesn't do it automatically, maybe the Windows partition when over some size limit, then add the compact command to the Post-setup page, that will work.

I did retest on the same machine without the entry, and query returns:
"The system is not in the Compact state but may become compact as needed."
So I guess the post-setup command is necessary for big drives, while smaller partitions (don't know the exact limit), can be compacted using the existing unattended option.
I'll think about adding it in both places regardless to make sure it sticks. Once you add it to the post-setup it will stick in your preset (Add Command: "compact", Parameters: "/compactos:always") - without quotes.

Let me know how it goes.
Thanks.

My SSD is 128GB, so Windows doesn't compact itself by default.

Running "compact.exe /CompactOS:Always" in CMD after installation works fine, so I also think it just needs to be added in both places to work in NTLite.

Thanks for looking into it!
 
Back
Top