Solved

File associations

Posted on 1997-05-13
5
349 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 150 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

Technology Partners: 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!

Question has a verified solution.

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

While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
An article on effective troubleshooting
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…
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…

726 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