1.    11 Aug 2016 #1
    Join Date : Aug 2016
    Posts : 4
    Windows 10

    Unable to associate extensions/file types with BAT scripts

    Using the assoc and ftype commands, I was always been able to associate certain extensions/filetypes with certain Batch scripts. But, this didn't appear to be be working in Windows 10.

    The following commands (run in a Admin command prompt) work fine in Windows 8.1 but not Windows 10:
    assoc .foo=Foobar
    ftype Foobar=C:\WINDOWS\system32\foo.bat %1
    echo @echo off > foo.bat
    echo echo The filename is %1>> foo.bat
    echo hi > foo.foo

    The result should be the output:
    The filename is C:\WINDOWS\system32\foo.foo
    Windows 10 appears to do nothing, but then I thought of changing the foo.bat script to redirect to a log file, so foo.bat now looks like this:
    @echo off
    echo The filename is %1 > foo.log
    When running foo.foo, foo.log is created, so we know that the file association (.foo files associated to foo.bat) is working and foo.bat is running. It's just that there's no output in the DOS window.

    Also, adding a "pause" command at the end of foo.bat does NOT pause at all, so this shows that input and output are both broken/redirected.

    What could be causing this input/output redirection? Remember, it only happens when running the foo.foo file directly. If you run "foo.bat foo.foo", it's fine.

    Last edited by jimtut; 11 Aug 2016 at 10:02. Reason: formatting
      My System SpecsSystem Spec

  2.    11 Aug 2016 #2
    Join Date : Aug 2016
    Posts : 4
    Windows 10


    Looks like Microsoft changed the polarity of a setting in the registry for Windows 10, and there's a simple fix for it.


    Set HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\InheritConsoleHandles to 0.
      My System SpecsSystem Spec


Similar Threads
Thread Forum
Solved wrong icon for certain file types windows 10
I had installed a program to convert some video files to a type I can play with an xbox. After I downloaded the program I noticed a bunch of the icons on my desktop were now this: 84503 I immediately uninstalled the program and ran virus...
General Support
Solved Any good Batch file renaming software / scripts
Hi there does anybody have any decent batch file renaming software or scripts. Here's a whole slew of music files from BBC Radio 3 -- what I want is after the word Breakfast in the title to insert date and time (european format YYMMDD.HHMM -24...
General Support
An odd MS decision for Onedrive music file types upload
Apparently, Ondrive will ONLY allow you to upload .mp3 and .wma files....I have an enormous amount of ripped from CD and elsewhere .flac files, which are true lossless format that I wanted to put on Onedrive....and here's the amazingly, yet classic...
Software and Apps
How do I permanently change icons for file types?
I was using FileTypesMan, but it seems to revert to default settings every time I restart the computer.
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 01:59.
Find Us
Twitter Facebook Google+

Windows 10 Forums