Opening a file with an unknown extension.

Posted on 2014-01-23
Last Modified: 2014-01-23
Hi Experts
we have an archiving system that stores files in the following format
within the system it logs the relevent file to the relevent extension so we know that file is a TIF file.
The question is how can I get windows to open file as a TIF with-out create a temorary file?
Question by:daveslater
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 39802612
if the .xxx is always the same, and it will always be .tif, you can attach that extension .xxx to the same app as the .tif.
is the above assumption true or not?
LVL 43

Accepted Solution

Steve Knight earned 250 total points
ID: 39802626
Unless what Guy says is true then presumably you must use the archiving system to extract the relevant file, temporarily rename/copy the file or similar.  You could have something like a shortcut to this batch file on desktop which you can drag a file onto it, it will create temp file called by original name but tif on the end, launch it then ask if to delete it.


@echo off
if "%~1"=="" (
  echo Drag a file to this icon and it will open as if a TIF file
  exit /b
set filename="%temp%\%~f1.tif"
copy /y "%~1"  "%filename%"
start /w "" %filename%
echo Press Return to delete the temporary file, anything else or close the window to leave it
set answer=Yes
set /p answer=
if "%answer%"=="Yes" del "%Filename%"

Open in new window

[Edit: corrected typo]

Expert Comment

by:Aditya Arora
ID: 39802864
Right click on a file then go to Its properties and then click on change and then select the viewer/program in which you open the TIF file >apply and then OK
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

LVL 14

Author Comment

ID: 39802920
the extension will always be different - it is use base62 to calculate the file name.
00000000.aa1 might be TIF
00000000.aa2 might be pdf
00000000.aa3 might be outlook message
00000000.aa4 might be tif

so the possible number of suffixes will be about 35000

LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 250 total points
ID: 39802953
sorry to say, but with windows explorer alone you won't be able to solve this.
LVL 43

Expert Comment

by:Steve Knight
ID: 39803423
Well with batch file like I said you can have it open file renaming it one specified BUT it won't know what the file is to rename it, you'd have to decide.

Is there an API available for this archive app that can be called, e.g. from VBScript to retrieve a specific file for you?

LVL 14

Author Comment

ID: 39803717
I have come up with a sort of solution
basically the application builds the path and passes it to a batch file.
this batch file then creates a link with the correct extension then it STARTS the link and then delets the link.

rem set files name
set LinkFile=%TEMP%\%~2
set ActFile=%~1

rem make sure the link does not exist
del %LinkFile%
mklink %LinkFile% %ActFile%

rem Run the default application
start %LinkFile%

rem delate for a few mill secs to let the application launch
Ping -n 1 -w 10
rem tidy up
del %LinkFile%
exit \b

Open in new window

LVL 43

Expert Comment

by:Steve Knight
ID: 39804999
Good idea if it works for you.  Not sure that always works but if it does for you great.

Surely the trouble here is that the application involved then has a file called open in it?

LVL 14

Author Closing Comment

ID: 39805034
Thanks for the input Guys&Girls it helped me with the final fudge knowing what windows can and can not do.

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Issue: One Windows 2008 R2 64bit server on the network unable to connect to a buffalo Device (Linkstation) with firmware version 1.56. There are a total of four servers on the network this being one of them. Troubleshooting Steps: Connect via h…
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question