Portable .LNK files
Portable .LNK files
Motivated by a recent Lifehacker article at the topic, I decided to do something about ubiquitous misinformation that .lnk files aren't (and can't be) portable.
Really, they usually aren't, but CAN be.
I wrote a quick and dirty program, that generates portable .lnks.
Get it.
Really, they usually aren't, but CAN be.
I wrote a quick and dirty program, that generates portable .lnks.
Get it.
Last edited by m^(2) on Mon Jul 28, 2008 1:22 am, edited 2 times in total.
-
- Posts: 123
- Joined: Wed Sep 19, 2007 7:56 pm
m^2 said
Also how does one work this "lnker.exe" app, step by step.[/quote]
please explane the above in newbe talk, step by step.This article is wrong,
http://lifehacker.com/399293/create-sho ... -usb-drive
you CAN create relative shortcuts. No batches are needed.
Sample: A .lnk that opens a.txt in own directory.
MIME-Version: 1.0
Content-Type: application/octet-stream; name=”a.txt.lnk”
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=”a.txt.lnk”
TAAAAAEUAgAAAAAAwAAAAAAAAEaKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAFAGEALgB0AHgAdAA
Also how does one work this "lnker.exe" app, step by step.[/quote]
I did some searching and figured out a workaround to make shortcuts that use relative paths. Unfortunately, this workaround still flashes a command window before launching the target.
To start siw.exe using a shortcut placed in the same directory, enter the following as the target:
and then enter %cd% as the "Start In" directory.
If siw.exe is in the SIW subdirectory of where you place the shortcut, the target will be:
Likewise, to link to SIW in a parallel directory:
The above only works on Windows NT and later. To do this on Win 95, 98, or ME, you can enter start.exe instead of cmd.exe /C start:
If you want to use the same shortcuts on XP and 98, you're out of luck.
I found information on this page under the heading "file management", but it pertains only to Windows 95, 98, and ME, so I combined it with info from this page.
To start siw.exe using a shortcut placed in the same directory, enter the following as the target:
Code: Select all
%windir%\system32\cmd.exe "/C start siw.exe"
If siw.exe is in the SIW subdirectory of where you place the shortcut, the target will be:
Code: Select all
%windir%\system32\cmd.exe "/C start SIW/siw.exe"
Code: Select all
%windir%\system32\cmd.exe "/C start ../SIW/siw.exe"
Code: Select all
%windir%\system32\start.exe "siw.exe"
I found information on this page under the heading "file management", but it pertains only to Windows 95, 98, and ME, so I combined it with info from this page.
I'm not sure, but couldn't you use nircmd.exe instead of cmd.exe or start.exe to make this run on all platforms?ashghost wrote: If you want to use the same shortcuts on XP and 98, you're out of luck.
http://www.nirsoft.net/utils/nircmd.html
With the "execmd" option, it won't even display anything on the screen.
You could, and I was aware of it, but you would need to have nircmd installed on every machine you use, since you couldn't have a persistent path to nircmd.exe on your usb drive.appsuser wrote:I'm not sure, but couldn't you use nircmd.exe instead of cmd.exe or start.exe to make this run on all platforms?
@m^(2) Thanks for pointing that out. I had realized it myself by the time I read your post.
-
- Posts: 82
- Joined: Tue Feb 13, 2007 2:40 pm
Re: Portable .lnk files
I figured out how to use lnker. The readme files says:m^(2) wrote:Motivated by a recent Lifehacker article at the topic, I decided to do something about ubiquitous misinformation that .lnk files aren't (and can't be) portable.
Really, they usually aren't, but CAN be.
I wrote a quick and dirty program, that generates portable .lnks.
Get it.
ADDED: It seems that my server has some issues now and the link doesn't work.
Temporary download: Get it.
Code: Select all
lnker .\prog\prog.exe
lnker linker.ink lnker.exe
and it successfully created a link - after I downloaded and installed:
msvcp60d.dll (not present on my WinXPSP2 system)
Next question might be; is there a way to create a link from the GUI without opening a command prompt window?
-
- Posts: 82
- Joined: Tue Feb 13, 2007 2:40 pm
-
- Posts: 123
- Joined: Wed Sep 19, 2007 7:56 pm
How one works lnker, step by step guide.
How one works lnker, step by step guide.
1. Create a text file (.TXT) in the same folder as lnker.exe
2. Type the following to text file & save.
n.b. File path must not contain "&" (Bug?)
3. Rename the text file and change the extension to .BAT instead of .TXT
4. Run .BAT file.
1. Create a text file (.TXT) in the same folder as lnker.exe
2. Type the following to text file & save.
(that's the "file path" from intended link location to program file)lnker .\prog\prog.exe
n.b. File path must not contain "&" (Bug?)
3. Rename the text file and change the extension to .BAT instead of .TXT
4. Run .BAT file.
Re: How one works lnker, step by step guide.
Yes, it is a bug, you can't pass this sign in a command line unless it's enclosed in double quotes ("a&b.exe"), but such parameters aren't handled by lnker.Island Boy wrote: File path must not contain "&" (Bug?).
It's a minor thing and I don't intend to fix it though, sorry.
ADDED: I found a workaround. Create a shortcut to lnker.exe (usual, not portable one) and in the "target" field type:
C:\lnker.exe a&b.txt
-
- Posts: 123
- Joined: Wed Sep 19, 2007 7:56 pm
Seems to work well, but ...
Seems to work well as long as lnker.exe is not placed in any folder,
e.g. C:\lnker.exe or F:\lnker.exe or the like.
I can live with it.
e.g. C:\lnker.exe or F:\lnker.exe or the like.
I can live with it.