Solved

Editor for LNK Files

Posted on 1998-07-09
11
14,775 Views
Last Modified: 2013-12-28
I'm looking for an Editor to edit LNK Files in NT.
0
Comment
Question by:kuehn
11 Comments
 
LVL 1

Expert Comment

by:bwgerho
ID: 1784826
I am not familiar with a LNK file, but if it is simply a text file, you can change the file extension to txt, edit using word pad, word, notepad; save the file, change the name back to a LNK.  You may also be able to simply open the LNK file as a text file in WORD if you select the "all files" option in the open screen.
0
 
LVL 1

Author Comment

by:kuehn
ID: 1784827
LNK Files are no Text files. This are BIN-Files. Example: If you place an Icon on your Desktop, Notepad.exe, on your desktop, then there is an LNK File called notepad.lnk. And I would like to edit this contents of this file with an Editor. Not with the Properties button.
0
 
LVL 3

Expert Comment

by:gpipes
ID: 1784828
LNK files are not files in there own right they simple are shortcuts that link to files that are already there.
You can add startup parameters with these but they are not the actual program they are just a link to the file.
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 2

Expert Comment

by:moellert
ID: 1784829
Did you tried using Quick View Plus ?
0
 
LVL 1

Author Comment

by:kuehn
ID: 1784830
I don't know what is quick view plus. I have tried to open them with Norten Commander in Hex and bin mode. My problem is, that I would like to adminitrate a lot of NT Workstation and we have a program, that needs an user id in the command line. This Command line is in the *.lnk file.

0
 
LVL 1

Expert Comment

by:Arkadiy
ID: 1784831
You can write your own program using IShellLink interface. Something like:



void main(int argc, char *argv[])
{
    HRESULT hres;

    char szGotPath[MAX_PATH];
    char szDescription[MAX_PATH];
    WIN32_FIND_DATA wfd;
 
    *lpszPath = 0; // assume failure
 
    // Get a pointer to the IShellLink interface.
    IShellLink* psl;
    hres = CoCreateInstance(&CLSID_ShellLink, NULL,
            CLSCTX_INPROC_SERVER, &IID_IShellLink, &psl);
    if (SUCCEEDED(hres)) {
 
        // Get a pointer to the IPersistFile interface.
        IPersistFile* ppf;
        hres = psl->QueryInterface(&IID_IPersistFile,
            &ppf);
        if (SUCCEEDED(hres)) {
 
            // Ensure that the string is Unicode.
            WCHAR wsz[MAX_PATH];
            MultiByteToWideChar(CP_ACP, 0, argv[1], -1, wsz,
                MAX_PATH);
 
            // Load the shortcut.
            hres = ppf->Load(wsz, STGM_READWRITE);
            if (SUCCEEDED(hres)) {


                        //this is where you modify the shotcut

                        psl->SetArguments(argv[2])
                        
           
                  
                  
                  }

            hres = ppf->Save(wsz, TRUE);

        // Release the pointer to the IPersistFile interface.
        ppf->lpVtbl->Release(ppf);
        }
    // Release the pointer to the IShellLink interface.
    psl->lpVtbl->Release(psl);
    }
    return hres;
}
 


DISCLAIMER: i've never run or even compiled this program, it's just a sceleton code from MS help that I changed a bit. But it gives you an idea.
0
 
LVL 1

Author Comment

by:kuehn
ID: 1784832
I have no compiler for NT.
0
 
LVL 1

Expert Comment

by:thomasda
ID: 1784833
There is an NT Resource Kit Utility called Shortcut.EXE and it can modify shortcut files.
The most useful thing for NT users it that it can make a Shortcut Non-Tracking, which can be useful.  I don't know if you can get SHORTCUT.EXE without getting the kit.. you might want to search the net. It is a big place out there ;)
0
 
LVL 1

Author Comment

by:kuehn
ID: 1784834
I have searched the net and I have searched the ResKit, but I have not found Shortcut.exe for NT as an lnk editor. There are a lot of programms called, shortcut.exe in the net. But nothing for this job.

0
 
LVL 1

Author Comment

by:kuehn
ID: 1784835
Hi

I have solved the Problem. The tool shortcut.exe only works under Win95. Not under NT. There is a tool, called scut.exe at http://www.coffeecomputing.com/free/index.html. This works under NT and 95.
0
 
LVL 1

Accepted Solution

by:
phillydee earned 20 total points
ID: 1784836
You can use Windows scripting host to modify shortcuts or .lnk files.

You will need to create a small script which opens the file as an object and then you simply modify the properties of the object.

You can get all of this from www.microsoft.com/scripting.



0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

813 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

14 Experts available now in Live!

Get 1:1 Help Now