?
Solved

File associations

Posted on 1997-05-13
5
Medium Priority
?
357 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
[X]
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
5 Comments
 
LVL 2

Expert Comment

by:lorned
ID: 1778359
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 300 total points
ID: 1778360
Answer follows in a Moment ...
0
 
LVL 5

Expert Comment

by:cer
ID: 1778361
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
ID: 1778362
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
ID: 1778363
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

7 Extremely Useful Linux Commands for Beginners

Just getting started with Linux? Here's a quick start guide that has 7 commands that we believe will come in handy.

Question has a verified solution.

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

I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

762 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