Re: Datei erstellen im Netz
Verfasst: Mi, 02. Sep 2020 13:43
Okay, lasst uns eine Liste mit möglichen Ursachen zu dieser präzisen Problembeschreibung machen. Ich übernehme die ersten tausend, dann kann jemand anderes einsteigen.
Das deutschsprachige Forum für Entwickler in der Xbase-Welt, ein Angebot des Deutschsprachige Xbase-Entwickler e. V.
https://xbaseforum.de/
sag mal wie heisst die "Quell" Datei ? (voller Path)Rolf Ramacher hat geschrieben: ↑Mo, 31. Aug 2020 15:37 mit FCreate erhalte ich die Meldung Fehler beim Schreiben, copy to funktioniert auch nicht - Fehler 3 Pfad nicht gefunden. ist aber in der Datenbank richtig eingestellt z:\import
Code: Alles auswählen
FUNCTION SetzeNWLW(cPfad)
LOCAL cLW := ""
LOCAL aLWName := { "Z:", "Y:", "X:", "W:", "V:", "U:", "T:", "S:", "R:", "Q:", "P:", "O:", "N:", "M:", "L:", "K:", "J:", "I:", "H:", "G:", "F:", "E:", "D:" }
LOCAL nCounter := 1
FOR nCounter = 1 to 23
If GetDriveType( aLWName[ nCounter ] ) = 1
cLW := aLWName[ nCounter ]
StarteDatei( "/C START NET USE " + cLW + " " + cPfad )
* RunShell("/C START NET USE " + cLW + " " + cPfad , , .f., .F.)
Exit
Endif
Next nCounter
RETURN cLW
FUNCTION KillNWLW( cLW )
RunShell("/C START NET USE " + cLW + " /DELETE /YES" , , .f., .F.)
RETURN NIL
Code: Alles auswählen
FUNCTION StarteDatei(cDatei, cArt, cDir, cPara)
// Bsp.: StarteDatei("explorer.exe", , , "c:\windows\logs")
// Bsp.: StarteDatei("www.web.de")
// Bsp.: StarteDatei("calc.exe")
RETURN ShellExecute(NIL, if(cArt == "D", SHELL_PRINT, SHELL_OPEN), cDatei, cPara, cDir)
Code: Alles auswählen
***********************************************************************************************************************************
*** ***
*** FUNCTION GetDriveType(cDrive) ***
*** ***
*** Art des Laufwerks ermitteln ***
*** ***
*** Rückgabewerte: ***
*** "UNKNOWN" 0 The drive type cannot be determined. ***
*** "NO_ROOT_DIR" 1 The root path is invalid; for example, there is no volume mounted at the specified path. ***
*** "REMOVABLE" 2 The drive has removable media; for example, a floppy drive, thumb drive, or flash card reader. ***
*** "FIXED" 3 The drive has fixed media; for example, a hard disk drive or flash drive. ***
*** "REMOTE" 4 The drive is a remote (network) drive.
*** "CDROM" 5 The drive is a CD-ROM drive.
*** "RAMDISK" 6 The drive is a RAM disk.
* Aufruf
* GetDriveType("C:")
*
FUNCTION GetDriveType(cDrive)
LOCAL nDll,nType
nDll := DllLoad("Kernel32.dll")
IF nDll > 0
nType := DllCall(nDll,DLL_STDCALL,"GetDriveTypeA",cDrive)
DllUnload(nDll)
ENDIF
RETURN nType
*** UNC Name des Laufwerks ermitteln
*
* Rückgabe UNC-Pfad bzw. Laufwerksbuchstabe
* Aufruf:
* GetUNCName("C:")
*
FUNCTION GetUNCName(cDevice)
Local cServerName:=Space(512)
Local nLength :=512
LOCAL nLastError := 0
cDevice:=Upper(AllTrim(StrTran(cDevice,':','')))+':'
nLastError :=DllCall( "Mpr.Dll", DLL_STDCALL, "WNetGetConnectionA", @cDevice, @cServerName, @nLength )
nLength :=At(Chr(0),cServerName)
If nLength>0 //!Empty(cServerName)
cServerName:=Left(cServerName,nLength-1)
Else
cServerName:=cDevice
EndIf
Return AllTrim(cServerName)
Code: Alles auswählen
copy \\mydomain\data\txt\text.txt .
Code: Alles auswählen
copy \\mydomain\data\txt\schriller text.txt .
Code: Alles auswählen
copy "\\mydomain\data\txt\schriller text.txt" .
das weiß ich wohl, habe es aber eingefügt, da die Verzeichnisnamen (hier nur Platzhalter) ja unbekannt sind