Solved

File associations

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

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

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

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Learn how to PXE Boot both BIOS & UEFI machines with DHCP Policies and Custom Vendor Classes
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
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…

840 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