+ Post New Thread
Results 1 to 5 of 5
Windows Thread, Using assoc to change file associations in Technical; In the past i've used assoc in a .bat file to change file associations on multiple computers e.g. assoc .bmp=Paint.NET.1 ...
  1. #1
    cookie_monster's Avatar
    Join Date
    May 2007
    Location
    Derbyshire
    Posts
    4,217
    Thank Post
    394
    Thanked 278 Times in 239 Posts
    Rep Power
    75

    Using assoc to change file associations

    In the past i've used assoc in a .bat file to change file associations on multiple computers e.g. assoc .bmp=Paint.NET.1 the problem i'm having is that on certain stations where i've removed VLC Player i can't find how to associate .mpg with Media Player again. When i make changes it isn't changing HKLM it's changing HKCU.

    This is the command i'm trying assoc .mpg=wmplayer.exe

    Any ideas?

    Cheers.

  2. #2

    Join Date
    Jan 2006
    Posts
    9
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    You will also need to use the ftype command.

    The "assoc" command tells it what command to use in "ftype".

    I think the default assoc for .mpg is mpegfile, so the command to set this is:


    assoc .mpg=mpegfile


    With the "ftype" command you then tell it what to open mpegfile with, so this is where you tell it to open with media player. I've just checked my machine and the default command is c:\Program Files\Windows Media Player\wmplayer.exe /prefetch:9 /Open "%L"

    so the command for this is:


    ftype mpegfile="c:\Program Files\Windows Media Player\wmplayer.exe" /prefetch:9 /Open "%L"

    Hope this helps.

  3. #3
    cookie_monster's Avatar
    Join Date
    May 2007
    Location
    Derbyshire
    Posts
    4,217
    Thank Post
    394
    Thanked 278 Times in 239 Posts
    Rep Power
    75
    Ahh ok i'll try the ftype command i had already tried assoc .mpg=mpegfile but that didn't change anything.

    I've got a reg frag that works at the moment but i'd like to sort it for future reference.

    Cheers.

  4. #4

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,157
    Thank Post
    116
    Thanked 529 Times in 452 Posts
    Blog Entries
    2
    Rep Power
    124
    Are you running this at logon or system startup? (or while logged on?) If it's not running as a machine startup script then I think this is "by design" - software should look at HKCU before HKLM to see what to do for things like this.

  5. #5
    cookie_monster's Avatar
    Join Date
    May 2007
    Location
    Derbyshire
    Posts
    4,217
    Thank Post
    394
    Thanked 278 Times in 239 Posts
    Rep Power
    75
    I tried it as a startup script which did work for the paint.net example that was given above.



SHARE:
+ Post New Thread

Similar Threads

  1. Which file do I need to edit to change front page graphics?
    By reggiep in forum EduGeek Joomla 1.0 Package
    Replies: 2
    Last Post: 22nd April 2008, 03:18 PM
  2. File Associations
    By OutLawTorn in forum Windows
    Replies: 6
    Last Post: 10th September 2007, 12:36 PM
  3. VBS Change File on a Certain Line?
    By Samson in forum Scripts
    Replies: 7
    Last Post: 31st August 2007, 11:52 AM
  4. Replies: 12
    Last Post: 20th November 2006, 02:33 PM
  5. Replies: 4
    Last Post: 23rd March 2006, 07:27 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •