Sometimes a client will ask you to change the default windows program for them. It’s easy enough to do from Windows itself but what if you want to change it without disturbing them? This is where we can use a remote command line to change the file associations to do this in the background without disturbing them. In this case, we were asked to change wav files from opening up in iTunes.
Step1. Open your remote command prompt
This can be either through your RMM or using PSEXEC. This needs to be elevated.
Step 2. Execute the “assoc | more” command
From the command prompt type
assoc | more
This will list your current file associations. Now in this case we are going to be changing wav files to opening with Windows Media Player instead of iTunes. There are two options here. We can either find a similar extension such as WMA and type in the same details for WAV or we can use the full path to the program.
For example, WMA is associated as .wma=WMP11.AssocFile.WMA
We can type either of the following commands and it will achieve the same result
assoc .wav=WMP11.AssocFile.WAV
or
assoc .wav="C:\Program Files\Windows Media Player\wmplayer.exe"
Step 3. Check the new association
From the command prompt type:
assoc .wav
I have already tried it but error occurred:
Access is denied.
Error occurred while processing: extension.
as descrived above, you need to elevate your command prompt
that being said, as I tried it didn’t seem to take an effect. in windows 10 version 2004
you can confirm your new assoc but the file is opened by the old program anyway
To remove association:
assoc .wav=