• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1211
  • Last Modified:

Creating file association from a command line.

I have several clients running windows xp home addition.  They use Microsoft Office Document Imaging to view incomming faxes from the internal website on our Windows SBS 2k3 (MSPVIEW.EXE).  The problem is certain apps keep steeling the file associations for the .tif files.  My useers are not very technically savy and they are not onsite so I need to know if there is a way to reassociate MSPVIEW.EXE with tif files through a command line or by adding a registry key.  this way I could simply write a simple cmd file and make an icon for them to run whenever it breaks.  This issue needs to be resolved pretty quickly so I am going to give it a high point value.
0
allanhendershot
Asked:
allanhendershot
1 Solution
 
oBdACommented:
To do that from the command line, you need two things:
* an association from the extension to a document type
* a file type, telling the OS which program to start with the extension

For the former, you need the command "assoc":
C:\>assoc .tif
.tif=MSPaper.Document

For the latter, you need the command "ftype":
C:\>ftype mspaper.document
mspaper.document="C:\Program Files\Shared Data\Microsoft Shared\MODI\11.0\MSPVIEW.EXE" "%1"

So to set the .tif associtation back to the original, use a small batch script.
Verify the correct association name and program path by entering the commands above, and use those; it should look similar to that:

@echo off
assoc .tif=MSPaper.Document
ftype mspaper.document=C:\Program Files\Shared Data\Microsoft Shared\MODI\11.0\MSPVIEW.EXE" "%1"
0
 
allanhendershotAuthor Commented:
Perfect.  Worked like a charm. Thank you.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now