Finding default folder.

This forum is for eXpress++ general support.
Post Reply
Message
Author
omni
Posts: 531
Joined: Thu Jan 28, 2010 9:34 am

Finding default folder.

#1 Post by omni »

Roger,

We are trying to update our app to run under any method user happens to start. For years we have had a mapped drive and specific folder. We do not need or want to change the folder, but the mapped drive is at times a problem if users search for the exe and open using the long server path. We have changed it to also accept this, which works if opened in explorer using the DC_CurPath(). However, if a shortcut is created on the desktop the results is c:\users....., which obviously does not work.
Is there a command to see where the app is loaded on a shortcut, similar to the DC_CurPath(). Cannot find one that works, at least not so far. If not, then I guess we will have to load the long path in our ini startup file.

Thanks, and have a great 4th.

Fred
Omni

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Finding default folder.

#2 Post by rdonnay »

This will give you the path of the running application .Exe

Code: Select all

cPath := DC_Path(AppName(.t.))
The eXpress train is coming - and it has more cars.

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: Finding default folder.

#3 Post by Auge_Ohr »

omni wrote:using the long server path
did you have " " ( Space ) in your Shortcut Path ?

perhaps you can use "Shortname" without " " (Space).

Code: Select all

FUNCTION GetShortFileName(cLongName)
LOCAL cShortName := space(255)
LOCAL nNameLen   := 1
   if empty(cLongName)
      return ('')
   else
      nNameLen := DllCall("Kernel32.DLL", DLL_STDCALL, "GetShortPathNameA", ;
                          cLongName, @cShortName, len(cShortName))
   endif
return (left(cShortName, nNameLen))
greetings by OHR
Jimmy

Post Reply