Solved

File associations

Posted on 1997-05-13
5
317 Views
Last Modified: 2013-12-28
I need create file association to run programm associated with this file extension, but I need to give file name without extension as a argument to this programm.
0
Comment
Question by:polasek
  • 3
5 Comments
 
LVL 2

Expert Comment

by:lorned
Comment Utility
You need to give more details on what you are trying to do.  What OS are you using?

Lorne
0
 
LVL 5

Accepted Solution

by:
cer earned 150 total points
Comment Utility
Answer follows in a Moment ...
0
 
LVL 5

Expert Comment

by:cer
Comment Utility
What you want is not possible in NT without tools (as far as I know).
Create a shortcut with the explorer or FTYPE to your extension.
Define option OPEN and action "d:\winnt\system32\cmd.exe /c d:\user\x\x.cmd %1"
D:\user\x\x.cmd is only a sample CMD file which does the following:
- extract the name from the full path/name.extension
- start your desired program with name as argument

I have a program CUTEXT.EXE that (nearly) does it. It fails when there is a path before the filename. But I think 4DOS or KIXTART will do:  
   http://www.xs4all.nl/~akhw/winnt.htm
In KIXTART you can use INSTR and SUBSTR to get the name (which is between last "\" and "."

0
 

Author Comment

by:polasek
Comment Utility
Of course The idea of running external file is known. But I prefere solution which uses (e.g.) regular expressions or uses variety of integreted commands of Windows NT, which can be found on every instalation.
I decided to increase point value to 150.
Thank you for your interest to help me solv my problem.
PS to lorned: I'm using Windows NT version 4.0 with service pack 2.0, but I think same situation is on Windows NT 3.5
0
 
LVL 5

Expert Comment

by:cer
Comment Utility
There are no regular expressions to get only the name without extension. You must use the "external" mode. If you want to use something provided by NT I think there is only QBASIC.
Write a Basic programm that modifies environment variable using the ENVIRON$ command. Be sure to run the program with option /RUN and the last command is SYSTEM.
Use this programm in a batch (see above) and start your final program with the modified var.

I think this is the only way.


0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

A few months ago I had an issue with LaserJet 1020 printer which was installed to XP and Windows 7.  It was installed to XP and working, but when I tried to connect from a Windows 7 PC, it would attempt connection and then fail.  Sometimes the Spool…
Several part series to implement Internet Explorer 11 Enterprise Mode
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now