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:
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:
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:
The filename is C:\WINDOWS\system32\foo.foo
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.
echo The filename is %1 > foo.log
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.