ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

How to create relative shortcut for a USB drive?

(1/3) > >>

superboyac:
Since I'm trying to create a portable workstation on my USB stick, I'm running into this issue.

I need a way to create a shortcut that will launch my launchers.  Let me explain.  I'm going to use FARR and LBC as my portable application launchers.  However, when I first insert my USB stick, I'd like to be able to immediately launch those two from the root directory, even though their program files are elsewhere on the drive.  So, I need the shortcut to be able to handle relative paths, which Windows can't do.  Now, FARR and LBC can both handle relative paths, so that's not the problem.  That's why I say I need a shortcut to launch those launcher programs.

Anyway, I found this article:
http://www.freewaregenius.com/2008/07/24/how-to-create-shortcuts-with-a-relative-path-for-use-on-usb-drives/
And it works great, except for one thing:  The DOS window that pops up (because it's a bat file) won't close until the program it launches closes.  Not a big problem, but annoying.

So is there an alternative solution anyone can think of?  Maybe using an AHK script or something like that?  Or is there a program that already does things like this?

tinjaw:
I am assuming you have autorun disabled, otherwise, that is your answer.

superboyac:
I am assuming you have autorun disabled, otherwise, that is your answer.
-tinjaw (May 01, 2009, 12:26 PM)
--- End quote ---
Oh yeah, i forgot to mention that.  I want it to work on computers regardless of autorun.

fenixproductions:
2superboyac

What about using BAT files without compiling them?

You could write in them something like (for DifRes.exe application in "ala" path):


--- ---start "" "%~dp0ala\DifRes.exe"
This way CMD window will disappear automatically. %~dp0 is always replaced with the path to BAT file.

superboyac:
^^that works fenix!  But I thought it was cool to get the icon embedded in the file as well, like the compiled version.  Of course, your code doesn't work when compiled.

I know I'm being nitpicky.  Basically, just for the fun of it, I'm wondering if this can be done perfectly.

Navigation

[0] Message Index

[#] Next page

Go to full version