Solved: Setting shortcut parameters to open with specific application

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

mattisokay

Thread Starter
Joined
May 25, 2011
Messages
3
I've looked around quite a bit on both this forum and Google and can't seem to find an answer, so if this has been answered before, please forgive me and be so kind as to provide a link to a relevant topic.

I am using a TiddlyWiki stored on a USB flash drive. What I would like to do is set a parameter on the shortcut so that it always launches with a specific portable browser, also stored on the pen drive, rather than the defauly browser that is stored on the computer it is attached to.

Likewise, I have a few PDFs that I use regularly between machines, and would like to have them open using a portable PDF reader (Sumatra) which is also stored on the flash drive. That way, the PDF will always open to my last saved page, regardless of which machine I am using.

The computers I use are a home desktop PC (Win 7), home netbook (Win XP) and work laptop (Win XP).

If there is a different way to achieve this without using shortcut parameters, I would be more than happy to give it a whirl.

Cheers!
Matt
 

Ent

Trusted Advisor
Joined
Apr 11, 2009
Messages
5,467
First Name
Josiah
Make a shortcut to the program that you want to open it with.
Use the file name as the parameter for that shortcut.
 

mattisokay

Thread Starter
Joined
May 25, 2011
Messages
3
Thanks, Ent, that's worked a treat.

This now brings up a new, related issue. The shortcuts do not work for my different PCs.

At the moment, my shortcut target reads:
"F:\Apps\SumatraPDFPortable\SumatraPDFPortable.exe F:\Docs\GM.pdf"
Double-clicking the shortcut opens the GM.pdf file in Sumatra. Perfect.

However, while this works on my work laptop, the "F" drive at home is already in use due to heavy partitioning of my 3 HDD's. Due to lack of admin permissions at work, I am unable to specify the drive letter of my pen drive. Any ideas on how to make this work across my different machines?

I could give my home "F" drive a new letter and specify the pen drive as "F" at home, but is there another way of going about this within the shortcut, without changing drive letters?
 

Ent

Trusted Advisor
Joined
Apr 11, 2009
Messages
5,467
First Name
Josiah
Since both the shortcut, target file, and the program are all on the flash disk, the obvious trick would be to use relative links rather than absolute ones. Unfortunately Windows won't let you use relative paths for shortcuts, but you can use them in scripting. If the shortcut is in the root of your Flash disk replace it with a batch file with the single line

start %CD%Apps\SumatraPDFPortable\SumatraPDFPortable.exe %CD%Docs\GM.pdf

%CD% expands to the current path, in that case F:\
Other languages could be used for various minor advantages (e.g. avoiding the black command window that pops up temporarily.)
 

mattisokay

Thread Starter
Joined
May 25, 2011
Messages
3
Once again, Ent, that's worked perfectly. Just tested it on my work machine and it's working on both a PDF and on a TiddlyWiki entry using my portable browser. Thanks!
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top