Solved

Editor for LNK Files

Posted on 1998-07-09
11
14,905 Views
Last Modified: 2013-12-28
I'm looking for an Editor to edit LNK Files in NT.
0
Comment
Question by:kuehn
[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
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
Don't Miss ATEN at InfoComm 2017!

Visit booth #2167 to see the  new ATEN VM3200 32 x 32 Modular Matrix Switch. Other highlights include the VE8950 4K HDMI Over IP Extender, VS1912 12-Port DP Video Wall Media Player  and VK2100 ATEN Control System. Register now with Free Pass Code ATEN288!

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
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 …
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…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

688 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