NTLite messes up SetupComplete.cmd under some circumstances

freMea

Member
Hi,

Steps to reproduce :

1. Copy your $OEM$ folder in Windows source​
2. Load your image with NTLite​
3. Check Automate Post-Setup section.​
NTLite parsed my setupcomplete.cmd and divided in multiple commands
IrVXTw.jpg

Result :

If you didn’t notice this and use a such image to install Windows, here is what happens.
NTLite deletes C:\Windows\Setup\Scripts\SetupComplete.cmd and replaces it with the commands above. As a result, after Windows installation, although C:\Windows\Panther\UnattendGC\Setupact.log reports setupcomplete.cmd has run, your script didn’t work as expected because it never ran as a batch.

Workaround:

Copy your $OEM$ folder in Windows source after NTlite processes the image but before your create an ISO.

Expectation:

Why NTLite just don’t leave all what is in $OEM$ folder alone?
 
Hi,

NTLite uses the very same setupcomplety.cmd for post-setup commands, and to allow for easier setupcomplete management.
However, what you experienced is not expected and should be fixed once confirmed.

Are you saying that if I put any setupcomplete.cmd in $OEM$ it will be deleted?
But that is simply not so, can you please attach your setupcomplete if you confirm it with the latest version?
And the preset used would be best, so I have full environment for testing.

Thanks, and sorry for the inconvenience.
 
Tested now with NTLite 1.7.2.6717 without applying any presets.

Once image loaded and after saving image my original SetupComplete.cmd stays untouched. With 1.7.2.6650, I think the file was deleted. I suppose it should be ok with the last version now. But I haven’t tried to install ISO in a VM yet to confirm the SetupComplete.cmd is run properly but here is a sample that can be used for testing. If c:\custom Windows setup.log exists after setup, then it’s fine else same bug as my previous post.

Code:
:: ANY COMMENT HERE

@echo off
cls
cd /d "%~dp0"

 SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
:: =====================================================================
:: --- SET VARIABLES
:: =====================================================================
set log="c:\custom Windows setup.log"

:: ------------------------------
echo. > %log%
echo SUCCESS >> %log%

exit
 
I am both drunk and confused

Business as usual then, least you aint been on the mushrooms :p
SetupComplete.cmd and answer files, once you have them known working then back them up so you dont loosem, dvd, just drag them out of storage when needed and replace whatever NTLite puts in $OEM$, silly creating a new one everytime.
 
I don't have that issue, the setupcomplete.cmd file could be edited in some scenarios but isn't edited/deleted as it is.
 
After installing the ISO in a VM, I couldn't reproduce the bug in NTLite 1.7.2.6717. The script is run and create the log file. I guess it’s fixed now. I will post if I find out it is related with preset.
 
ı was having exact issue for 2 straight years.

I place my own oem folder at last step and never open post-setup section in ntlite. this way ntlite doesnt touch my setupcomplete file.


(also freMea if you integrate updates to iso, setupcomplete will be broken too. so don't)
 
Interesting. Did you post a bug report about that ? If is still reproductible in last release, you should.

yes i did post a bug about that via threads and private messages.

i think this is the reason: ntlite will use setupcomplete.cmd if you integrate updates just like it uses setupcomplete.cmd if you use post setup.
So when you put a setupcomplete.cmd file that you made manually to oem folder or directly iso's setup folder. and use postsetup or integratingupdates part. ntlite will try to edit or create setupcomplete which will not directly copy and paste your codes, and will not add its own codec to the end of the script, it will just edit and break your codes.

so thats why i never enter postsetup part after i place my own setupcomplete.cmd and never integrate updates.
 
I believe this is what freMea is referring to:

New first time load & configure
1641

After saving the image & applying & then loading the same image
1640

  • I new have commands called REM
  • My SCHTASKS.EXE commands are gone
  • My XML file now have parameters
For a newbie like me, it seems like NTLite trashes the Post-Setup commands
 
  • My SCHTASKS.EXE commands are gone
For this i can tell:
rd has been detected in that line and has been removed as rd command is being used for scripts folder removal, NTLite doesn't allow RD duplicated.

For some tasks i use oobe.cmd instead (not all tasks can run in oobe.cmd).
 
Kasual We need a decent explanation of setupcomplete v oobe, what each one does, their limitations and which one is the best for certain tasks.
 
Kasual We need a decent explanation of setupcomplete v oobe, what each one does, their limitations and which one is the best for certain tasks.
The difference is that oobe.cmd is run at earlier stage than setupcomplete.cmd, when some services aren't running yet.
Other than that, both are simply batch files.
 
Right, ok. Do you put an oobe.cmd in the same folder as setupcomplete.cmd?
Yes, that's it!
Drop the oobe.cmd in the same 'scripts' folder and it will do the magic.

Don't know if adding time (timeout command) would wait 'til the services are running (never tested), once oobe.cmd has run, a second or a minute later (depending on your steamroller) setupcomplete.cmd runs.
 
Theere are only a few tweaks i add during setup, thge Defender tweak wont work because i have to be elevated to stop those services.

I'll prolly have a nosey around ms and see whats possible but i do the bulk of tweaking after 1st logon because i need to be elevated.

77c1517e77da03831ecf2dded83faf09--young-frankenstein-the-young.jpg
 
Theere are only a few tweaks i add during setup, thge Defender tweak wont work because i have to be elevated to stop those services.

I'll prolly have a nosey around ms and see whats possible but i do the bulk of tweaking after 1st logon because i need to be elevated.

Are you trying to stop the services with net command?
 
Erm, i disable the service at ControlSet001, Services.
I could try a net stop command, i just use the above line. Because the services are greyed out on a running system i mpved defender disable to post setup and use power run. And i dont make the mistake of having my main storage drive attached, done that before and defender removed some stuff.
 
Last edited:
yes i did post a bug about that via threads and private messages.

i think this is the reason: ntlite will use setupcomplete.cmd if you integrate updates just like it uses setupcomplete.cmd if you use post setup.
So when you put a setupcomplete.cmd file that you made manually to oem folder or directly iso's setup folder. and use postsetup or integratingupdates part. ntlite will try to edit or create setupcomplete which will not directly copy and paste your codes, and will not add its own codec to the end of the script, it will just edit and break your codes.

so thats why i never enter postsetup part after i place my own setupcomplete.cmd and never integrate updates.
Hi ege914, didn't we went over your changes and fixed it?
If not, please send me a PM pointing to our chat where it's unresolved to the end, or here if it's a public link. Thanks.
 
Back
Top