This is by design
MSDN[
^]:
Application.StartupPath Property Value
Type: System.String
The path for the executable file that started the application.
This path will be different depending on whether the Windows Forms application is deployed using ClickOnce. ClickOnce applications are stored in a per-user application cache in the C:\Documents and Settings\username directory. For more information, see Accessing Local and Remote Data in ClickOnce Applications.
So, it is returning the same path - it's just that your program is not where you thought it would be...
"Thanks for replying OriginalGriff ... I've read something about Clickonce doing this, but can't get it explained ... I've had a problem trying to resolve this for a week now and am just getting nowhere !!! To be honest, I don't give a damn where the Setup program is or where it runs from, but I use the Path to get at the other data & folders I am deploying on the new machine. These could be on a USB or CD with any drive letter assigned, or indeed on any drive under any Folder, if my user copies them before running them. So how do I know my Path to access these files & folders, which are NOT moved to the username directory ?!?"
The best thing to do is to use a folder which can move, but which windows keeps a track of, and which full access is granted to all users - which is not the case for the folder the application is installed in!
There is a folder that fits the bill: The Common Application Data Folder - it is user independent (so all users of the computer use the same data and can read and write to it) If you create a folder beneath that and store your data in there, it will be easy to find.
The base directory is accessed thus:
string basePath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
If you append your application name (or better a fixed GUID value) and move everything to there it should be fine.