MS file path basics?

zooairz

Distinguished
Nov 18, 2006
3
0
18,510
Dear All,

I wrote in BASIC 25 years ago and...that's about it when it comes to programming. Can anyone provide a link or reference a simple file path rule book online?

My problem is that I use an USB MP3 player as a hardrive between work and home and it works fine for the most part, the PC just assigns it a drive. Once in a while I need to reference a certain file on my Personal Info Managaer (to do's, contacts, etc,)

I want to type the file path as a relative one so that it knows to just go to the file, no matter what drive it is on. A relative path. I have looked this up for many minutes now and all I can find is use a "." at the start of the path, or URL relative file paths. I just can't seem to get it to work.

I see %\folder\file, $\folder\file and all sorts of things, but I am just looking for a basic rule book to figure it out.

Any thoughts welcome. (Yes this is a basic question, you can laugh, but don't point.)

zoo
 

Scott2009

Distinguished
Sep 20, 2009
15
0
18,560
A relative path is 'relative' to the current working directory of whatever is being executed.

It 'may' always be different.

You could set a System/User Variable, ala the internal DOS 'SET' command, and use something like %YourVar%\dir\subdir\subdir\file.ext

It may require double \\, and/or even double %% depending on the language used.

Could also try @"%YourVar%\dir\subdir\subdir\file.ext" or similar.