ftp automation

ScriptFTP

The professional tool to automate FTP, SFTP, FTPS and schedule FTP batch jobs

The forum is now read only. Please, go to the the main ScriptFTP website if you need help.
Need help writing a script? Have any question about ScriptFTP?
I am trying to use the result of the localmkdir in the exec command see bottom of script
FTP Script
  1. # Blat parameters. This is the command line program
  2. # used in this example to send emails from ScriptFTP
  3.  
  4. $blat_path="C:\blat\Full\blat.exe"
  5.  
  6. $smtp_server="x.com"
  7. $smtp_user="x@x.com"
  8. $smtp_password="x"
  9.  
  10. $email_from="x@x.com"
  11. $email_to="xs@xl.com"
  12. $email_subject="RRS backup "
  13. $email_body1="Backup is complete on Zach\rrsbackup"
  14. $email_body2="The Red River Backup has started."
  15.  
  16. $common_part_1=$blat_path." -server ".$smtp_server." -u ".$smtp_user." -pw "
  17. $common_part_2=$smtp_password." -f ".$email_from." -to ".$email_to." -subject ".'"'
  18. $common_part_3=$email_subject.'"'
  19.  
  20. $cmd_line_part_4_1=" -body ".'"'.$email_body1.'"'
  21. $cmd_line_part_4_2=" -body ".'"'.$email_body2.'"'
  22.  
  23. # Concatenate the text string to build the complete command lines
  24. $blat_cmd_line_1=$common_part_1.$common_part_2.$common_part_3.$cmd_line_part_4_1
  25. $blat_cmd_line_2=$common_part_1.$common_part_2.$common_part_3.$cmd_line_part_4_2
  26.  
  27. #$aLocalDir = "B:\".(GETTIME(MONTH)."-".(GETTIME(day)."-".GETTIME(YEAR)))
  28. $aLocalDir = "B:\".(GETTIME(MONTH)."-".(GETTIME(day)."-".GETTIME(YEAR)."@".(GETTIME(HOUR)." ".(GETTIME(MIN)))))
  29. #$aLocalDir = "B:\".(GETTIME(Format1))
  30.  
  31. EXEC($blat_cmd_line_2)
  32.  
  33. LOCALMKDIR($aLocalDir)
  34. LOCALCHDIR($aLocalDir)
  35. EXEC("C:\Zip\zip.exe -r Antique.zip F:\RRS\Antique")
  36. Print($alocalDir)
  37.  
  38.  
  39.  
  40.  
  41. EXEC($blat_cmd_line_1)
  42. localchdir("x:\save")
  43. # ------------------------------------------
  44. # here is what i'm trying to do
  45. EXEC('xcopy "($localdir)"/e ')
  46. # ------------------------------------------

Thanks for any help
I am just getting started using scriptftp
FTP Script
  1. EXEC('xcopy x:\save '.$aLocalDir.' /e')
thank you for your help. does that mean that you don't change directories or does it matter where you are when you send the cmd

thanks
***** Script error on line 6, column 27: ")" expected
exec("xcopy " .$alocalDir '/e')
it does not like the switch however i put it
It works without the switch
dot and space are missing
FTP Script
  1. exec("xcopy " .$alocalDir.' /e')
That worked it had to have been the space in the /e

Thanks for your help