Gibt´s da sowas wie %homedir% ?
Wenn ja, soll ich dann einfach copyfile("%...%ordner",zzielordner$) schreiben?
Johann Wolfgang von Geothe hat geschrieben:Wie dieses oder jenes Wort geschrieben wird, darauf kommt es doch eigentlich nicht an, sondern darauf, daß die Leser verstehen, was man damit sagen wollte.
benpicco hat geschrieben: Wie kann ich rausbekommen, wo die exe Datei, die mein Programm ist
und ausgeführt wird, gespeichert ist![]()
Code: Alles auswählen
Procedure.s GetAppPath()
ProgrammPfad.s = Space(255)
GetCurrentDirectory_(255, @ProgrammPfad)
If Right(ProgrammPfad,1) <> ""
ProgrammPfad + ""
EndIf
ProcedureReturn ProgrammPfad
EndProcedure
Debug GetAppPath()
Code: Alles auswählen
Procedure.s GetAppPath()
If OpenLibrary(0,"kernel32.dll")
*ptrGetDir = IsFunction(0,"GetCurrentDirectoryA")
If *ptrGetDir
ProgrammPfad.s = Space(255)
CallFunctionFast(*ptrGetDir,255, @ProgrammPfad)
If Right(ProgrammPfad,1) <> "\"
ProgrammPfad + "\"
EndIf
EndIf
CloseLibrary(0)
EndIf
ProcedureReturn ProgrammPfad
EndProcedure
Debug GetAppPath()

Code: Alles auswählen
Procedure.s GetAppDir()
FullPath.s = Space(360)
DLL = OpenLibrary(#PB_Any, "Kernel32")
CallFunction(DLL, "GetModuleFileNameA", CallFunction(DLL, "GetModuleHandleA", 0), @FullPath, 360)
CloseLibrary(DLL)
FullPath = GetPathPart(FullPath)
If Right(FullPath, 1) <> "\" : FullPath + "\" : EndIf
ProcedureReturn FullPath
EndProcedure
Debug GetAppDir()Code: Alles auswählen
Procedure.s GetAppDir()
FullPath.s = Space(#MAX_PATH)
GetModuleFileName_(GetModuleHandle_(0), @FullPath, #MAX_PATH)
FullPath = GetPathPart(FullPath)
If Right(FullPath, 1) <> "\" : FullPath + "\" : EndIf
ProcedureReturn FullPath
EndProcedure
Debug GetAppDir()