Automated File Associations setup

tired-it

Member
Alright, so I've been working on a custom ISO project for a while now. I started with a clean Windows 11 image, popped it into HyperV, did some customizing and updates, sysprep'd it and eventually ended up with the ISO I'm using now in NTLite for some final tweaks. Sounds a bit convoluted, but there were some tweaks I wanted to do in Audit mode that I wasn't sure if I could do in NTLite and plus I wanted to see the changes visually.

Anyways, after testing the ISO on a laptop, everything worked as planned, but I didn't realize that modified file associations were not saved. Same goes for the default browser (Chrome). Using the two links below, I got a better understanding of why associations were not saving, but now I want to use the programs in the links to solve my issue.

Browser associations & File associations

For SetDefaultBrowser, I just need to run the command "SetDefaultBrowser.exe chrome" I ran it on a different computer to confirm it works. How can I implement this in NTLite to set it automatically? As I understand it, this command should be run after a user has logged in, so I'm assuming placing the file and command in the User section of Post-Setup?

For SetUserFTA, I exported the file associations into the config.txt file that I read about on the website. Basically all I did was save the image file extensions for Windows Photo Viewer, most music and video extension for VLC player and the PDF extension for Chrome. I'm not well versed with commands and how they work with NTLite (I've been trying to get an automatic wifi command working based on another thread for a few days now). Apparently, this program should be run in User mode too. I'll assume Post-Setup like before.

Anyone have suggestions for this?
 
Run SetUserFTA in Post-Setup (User). As covered in older threads, Windows UWP provisioning overrides many FTA defaults so many applied before the user's first logon are wiped out.

The trick is by the time you run any (User) command, SetupComplete.cmd which runs all (Machine) commands has finished -- wiping out the $OEM$ staging folder. So you need to copy your SetUserFTA file to a different folder like sources\$OEM$\$1\Folder, which maps to C:\Folder. This folder will survive the cleanup process.

Your SetUserFTA executable can be copied to the same folder, and run it with the expected path:
Code:
C:\Folder\SetUserFTA C:\Folder\config.txt
 
attempt1.png
I tried to move the TXT file to C:\Folder\SetUserFTA, but NTLite won't let me modify the location. Perhaps I should move the file to the User section too?

Edit: For what it's worth, the "\Setup\Files" folder seems to survive the Windows installation. I had already installed the ISO once with the "wifi.xml" file and after I reached the desktop, I checked the file directory and sure enough it was there. Though the command didn't seem to work, but that's a discussion for another thread.

Edit 2: I take it back, it must have been a fluke, but the "\Files" folder was indeed wiped out. Alright, so how do I copy the files to a different folder then?
 
Last edited:
Run SetUserFTA in Post-Setup (User). As covered in older threads, Windows UWP provisioning overrides many FTA defaults so many applied before the user's first logon are wiped out.

The trick is by the time you run any (User) command, SetupComplete.cmd which runs all (Machine) commands has finished -- wiping out the $OEM$ staging folder. So you need to copy your SetUserFTA file to a different folder like sources\$OEM$\$1\Folder, which maps to C:\Folder. This folder will survive the cleanup process.

Your SetUserFTA executable can be copied to the same folder, and run it with the expected path:
Code:
C:\Folder\SetUserFTA C:\Folder\config.txt
Probably shoulda hit reply last time. Ah well. Another note, is it possible to have the commands run every time a new user is added to the machine?
 
Run SetUserFTA in Post-Setup (User). As covered in older threads, Windows UWP provisioning overrides many FTA defaults so many applied before the user's first logon are wiped out.

The trick is by the time you run any (User) command, SetupComplete.cmd which runs all (Machine) commands has finished -- wiping out the $OEM$ staging folder. So you need to copy your SetUserFTA file to a different folder like sources\$OEM$\$1\Folder, which maps to C:\Folder. This folder will survive the cleanup process.

Your SetUserFTA executable can be copied to the same folder, and run it with the expected path:
Code:
C:\Folder\SetUserFTA C:\Folder\config.txt
An update, I figured out what you meant by copying to a different folder. I just had to go to where the cache of the ISO was and manually drop the files there. I removed the files from the machine execution queue. After an install, the files were still there as you said! Unfortunately, the code you suggested seemed nonfunctional for me. Doing it manually after I loaded into the desktop was a success, but the automation did not go through.

For clarification, I placed "C:\Folder\SetUserFTA" in the execution queue and the "C:\Folder\config.txt" in the parameters.

And for the default browser program, I simply had "chrome" in the parameters. Any ideas?
 
simple terms. what browser will you be using ? you direct ntlite to the standalone file for it and add. under perameters you add the switches required ( for example , /s or /silent ) for silent install. just putting down what browser you intend to use under parameters is just , how can i put this politely, unknowledgeable at best, dumb at worse
 
I'm trying to use a command to call a function from an exe file. I've done it before with the wifi connection. In the picture, I have the wifi information saved as an XML file and dropped into an OS folder. I used a command found in another thread to add that wifi information to the OS so it can connect automatically.

Similarly, I'm trying to have Windows run the SetUserFTA and SetDefaultBrowser executables in the user context so files associations are set automatically. I have Chrome preinstalled in the system, but it's not set as the default. I managed to make a folder in the root of the OS to save the executables and the config file so they survive the post-installation cleanup. But I can't quite figure out the commands to run them.
 
An update: I've attempted various versions of the commands and nothing seems to work. The files do remain after the OS installation and in the exact folder I specified on the root of the drive. I know the programs work because I can manually run them and they complete without error. Anyone have any ideas?
 
simple terms. what browser will you be using ? you direct ntlite to the standalone file for it and add. under perameters you add the switches required ( for example , /s or /silent ) for silent install. just putting down what browser you intend to use under parameters is just , how can i put this politely, unknowledgeable at best, dumb at worse
On the website for the SetDefaultBrowser.exe program, it mentions that I just have to run the command "SetDefaultBrowser.exe chrome" in order to set it as the default. Chrome is already installed, I just want it to be the default instead of Edge.
 

google is your friend
 

google is your friend
I was hoping to avoid chocolatey as I've never used it before, but it's a start.
 
UPDATE: Rewrote instructions to use a SetUserFTA config file, and remove folder when done. This method will work for other apps, if SetUserFTA is the last program in the Post-Setup list.

To make Chrome your default browser:

1. Create new ISO folder "sources\$OEM$\$1\SetUserFTA" (maps to C:\SetUserFTA)

2. Copy SetUserFTA.exe to this folder.
Open Notepad, create a new file "sources\$OEM$\$1\SetUserFTA\config.txt"​
Code:
http, ChromeHTML
https, ChromeHTML
.htm, ChromeHTML
.html, ChromeHTML

3. Add Post-Setup (Machine) commands:
Code:
ChromeStandaloneSetup64.exe /silent /install

4. Add Post-Setup (User) commands:
Code:
C:\SetUserFTA\SetUserFTA.exe C:\SetUserFTA\config.txt
cmd.exe /s rmdir /s /q C:\SetUserFTA

Capture.PNG

Confirm "start http://google.com" launches the right browser:

Windows 10 x64-2023-07-14-23-59-00.png
 

Attachments

  • Capture.PNG
    Capture.PNG
    59.1 KB
  • Windows 10 x64-2023-07-14-23-59-00.png
    Windows 10 x64-2023-07-14-23-59-00.png
    61.7 KB
Last edited:
Woah that's awesome! Looks like my understanding of the command code was almost correct. I appreciate the cleanup command; hadn't thought of that. I'll give this a shot and try to report back when I can.

On a semi-related note, if I add a Chrome REG file to the related section of NTLite, would the fresh install of Chrome overwrite the added registry files? I ask because I installed the administrative templates for Chrome on a test computer and made some changes, then backed up the registry directory for Chrome since exporting the Group Policy information was not feasible. At the moment, I have Chrome preinstalled, though switching to a standalone setup will probably be better since it's easier to update.
 
Applying admin templates will create new reg entries, which can be exported by regedit.
Code:
[HKEY_LOCAL_MACHINE\Software\Policies\Google\Chrome]
[HKEY_CURRENT_USER\Software\Policies\Google\Chrome]

Policy settings are never overwritten by a product install, and can exist whether software is actually on the system or not. It's just a rules set.
 
UPDATE: Rewrote instructions to use a SetUserFTA config file, and remove folder when done. This method will work for other apps, if SetUserFTA is the last program in the Post-Setup list.

To make Chrome your default browser:

1. Create new ISO folder "sources\$OEM$\$1\SetUserFTA" (maps to C:\SetUserFTA)

2. Copy SetUserFTA.exe to this folder.
Open Notepad, create a new file "sources\$OEM$\$1\SetUserFTA\config.txt"​
Code:
http, ChromeHTML
https, ChromeHTML
.htm, ChromeHTML
.html, ChromeHTML

3. Add Post-Setup (Machine) commands:
Code:
ChromeStandaloneSetup64.exe /silent /install

4. Add Post-Setup (User) commands:
Code:
C:\SetUserFTA\SetUserFTA.exe C:\SetUserFTA\config.txt
cmd.exe /s rmdir /s /q C:\SetUserFTA

View attachment 9994

Confirm "start http://google.com" launches the right browser:

View attachment 9995
 
Hi, I tried the script and it works great, but at the end of the installation the cmd window remains open, it doesn't close, it's paused, and I have to close it manually. Also can I add lines to the config.txt file to make Acrobat Reader the default PDF reader?
Thank you for all!!!
 
My bad. The last line should read "cmd.exe /c" not "cmd.exe /s", otherwise CMD doesn't exit.

You can append more FTA's if you need them. For example:
Code:
.pdf, AcroExch.Document.DC
 
Back
Top