first...
ARGH!!!!!!!

second:
Thanks to Steve Orth

Third:
ARGH!!!

Fourth:
I am creating a batch file to manage copying files from 1 location to 
another, in/on Windows.
I can create the batch file.
I can execute the batch file, from inside 4D
I just can not get the batch file to do it's damn job!!!!!

If I execute the batch file from the operating system (double click), 
or from the cmd UI (drag file, hit enter)
it WORKS!!!!  but NOT from LEP.

here is the 4D code (very very much shortened):
<snipped>
 - code to: validate the source, validate there is space at the 
destination, check for duplicate file/directory names (numbering the 
file/folder to create a unique name if needed), create the source 
directory (name) at the destination (I can't get DOS to create the top 
level [for the copy] folder, so I create it manually), append the newly 
created directory to the destination path, create the batch file, 
append the needed commands to the batch file with full paths, close the 
batch file
</snipped>
SET ENVIRONMENT 
VARIABLE("_4D_OPTION_BLOCKING_EXTERNAL_PROCESS";"true")  // wait for it 
to finish
LAUNCH EXTERNAL PROCESS("cmd.exe /K 
"+$Batch_File_Path;$LEP_Input;$LEP_Output;$LEP_Error)

-- $Batch_File_Path - contains the path to the batch file to be 
executed, it lives in (4D Command:Temporary Folder) 
C:\users\appdata\<something>\temp directory, (I have verified that this 
path is correct, and that the file exists at this location)
-- /K is *supposed* to keep the cmd window open - but does not
-- $LEP_Output returns the batch file contents, as executed: i.e. 
Command exe <return> xcopy.....
-- $LEP_Error always remains empty
-- $LEP_Input always remains empty

The content of the batch file is (exactly):
xcopy /E /H /C /Q /Y "E:\Chips stuff\testing\Untitled Fred Folder_Fri, 
Oct 27, 2017" "C:\Users\admin\Desktop\Testing moving\Untitled Fred 
Folder_Fri, Oct 27, 2017_003"

I have verified all the paths are correct.
E: is a usb drive
C: is the internal drive of the computer

Again.. if I execute the batch file from the desktop, or from the 
command line UI it works.
Executed from LEP - nothing, except a flash from the command window 
opening and closing

I initially was piping the stderr to a disk file (adding the following 
to the copy line above)
" 2>> char(Quote)+$ErrorLogfilepath+char(quote) 
Where $Errorlogfilepath = was the batch file name + error_log and with 
.bat replaced with .txt

When I ran the batch file from LEP, this file WAS created, it was 
blank, but it was created.
When I ran the batch file from command UI - the error log file was NOT 
created.

I can use any help here-- please
Thanks
Chip
---------------
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to