Run a file even if drive letter changes

By plasma dragon00
Oct 30, 2009
  1. Hey TS, got a question for ya all. I'm pretty sure I've seen this before, so it should be possible, but for the life of me I cant figure out how to do it.

    I have a program called CodySafe installed on my iPod (its a similar concept to the U3 launcher). I double click the .exe on my iPod (which, btw, I use as a portable disk to transfer the java programs I write for my AP Computer Science class in school). Then, it launches CodySafe.

    You can set it to auto-launch programs anywhere inside your portable disk. I guess it uses a config file somewhere.

    A program it auto launches is called MaZZick. You hold shift, and make a mouse gesture, and it runs a task or opens a program. I have a few custom gestures, for example, one to open FireFox (portable edition ;) ) and JCreator (my JAVA compiler). But, the drive letter can change (prime example - the cd drive isnt showing up in windows epxlorer anymore on this school computer. my iPod's drive letter always used to be E:\ here, but now, with the lack of a disk drive, is D:\.)

    What I need is a way so that, when I set the path in MaZZick of where the program is, I can use some sort of variable so that even if the drive letter changes, the program will know to look in the root of the drive that it is being run from.

    I think what I'm looking for is something along the lines of %APPDATA% and %WINDIR%. But, I can't figure out which one I would need (neither of those ones, at least, i think). I also tried removing the drive letter from the path of the program, so instead of "E:\CodySafe\Programs..." it was just "\CodySafe\Programs...". Didn't work.

    Thanks in advance for the help guys!!

  2. jobeard

    jobeard TS Ambassador Posts: 9,153   +598

    you need to add a new environment variable (eg: MaZZick) which points to the proper directory (including the DLA)

    then add %MaZZick% to your PATH variable (eg: at the end)

    maintain the MaZZick variable and it will allow you to use the command prompt to launch
    anything in that directory by the program name (ie without the full path to it).

    This will not work for programs on a thumbdrive, as each system has its own PATH variable.
  3. WinXPert

    WinXPert TS Guru Posts: 445

Topic Status:
Not open for further replies.

Similar Topics

Add New Comment

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...