Creating a shortcut without a drive letter

Posted on 2007-08-11
Last Modified: 2012-08-13
I am creating a program that will reside on a USB key. The program has a single EXE and multiple files that contain settings.

Here is the file structure:
I want to create a shortcut in W:\Widget\ for the EXE paired with the settings.

So in the shortcut (saved in W:\Widget) it would have:
  Shortcut: W:\Widget\Settings\program.exe settings1.ini
  Starting Folder: W:\Widget\
  (Same shortcut for settings2 and settings3)
So here's the problem:
When these are stored on a USB key, the drive letter can change on each computer.  In a shortcut, how can I create a shortcut without referencing a drive letter?

I tried .\ and ..\ and Windows won't let it work.

For example:
      Shortcut: .\Widget\Settings\program.exe settings1.ini
      Starting Folder: .\Widget\
      Doesn't work..

Any suggestions?
Question by:ahelgeson
    1 Comment
    LVL 3

    Accepted Solution

    Using batch files instead of shortcuts should solve your problem.

    The following line in a .bat file located in \widget will start the program and pass the right parameter for settings 1.
    @settings\program.exe .\settings\settings1.ini

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Issue: Unstable cursor in Windows XP and Windows runs extremely slow in that any click will bring up the Hour glass (sometimes for several seconds before giving you what you want) . Troubleshooting Process and the FINAL FIX: This issue see…
    INTRODUCTION The purpose of this document is to demonstrate the Installation and configuration of the Data Protection Manager product. Note that this demonstration was prepared on the basis of Windows OS is 2008 R2 and DPM 2010. DATA PROTECTI…
    This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
    The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

    760 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