I am trying to write an application to copy files from specified folders on a workstation to a server. I have stored the source and destination paths in an INI file. This way it could be changed easily. I am using Doug Henig's READINI program to read the paths.
The INI file looks like this:
[Server]
; The above section "Server" must be used
; The following entry is the Destination path
Directory1 = "D:\temp"
Directory2 = "D:\temp"
Directory3 = "D:\temp"
Directory4 = "D:\temp"
Directory5 = "D:\temp"
Directory6 = ""
[HomePath]
; The following entries indicate files to copy from the workstation
lcHomePath1 = "C:\Renee\Electrocardiogram Report"
lcHomePath2 = "C:\Renee\Event Monitors"
lcHomePath3 = "C:\Renee\Lexington Office Records"
lcHomePath4 = "C:\Renee\Providence Office records"
lcHomePath5 = "C:\Renee\Chest X-Ray Report"
lcHomePath6 = ""
The Copy program looks like this:
** Get the program server path
LOCAL lcdirectory1
lcdirectory1 = ADDBS(ALLTRIM(readini(lcIniFile,'Server','Directory1','%')))
** Get the program home path
LOCAL lcHomePath1
lcHomePath1 = ADDBS(ALLTRIM(readini(lcIniFile,'HomePath','lcHomePath1','%')))
WAIT WINDOW "Copying folder " + lcHomePath1 TIMEOUT 5
lcHomePath1 = "'"+lcHomePath1+"\*.*'"
lcdirectory1 = "'"+lcdirectory1+"\*.*'"
COPY FILE &lcHomePath1 TO &lcdirectory1
The problem is this works on my computer from the VFP IDE or an EXE. I have setup the same directory structure on another machine and I get the following message:
"File C:\Renee\Electrocardiogram Report\*.* does not exist." It looks like I have two problems 1) why does it work on my machine and not anywhere else? 2) How can I copy files from one directory to another when the directories could be more than 8 characters?
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement