• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Batch script issue

slevin4356

Junior Member
can anyone help me modifiying the batch script:

SETLOCAL
SET PGM=WTX
SET SYSNAME=G1234W
SET TRANSET=PS
SET Fltr="TLUS*.*"
.
.
IF [%PGM%]==[WTX] (
SET LPath="%LDrv%\WTXDTA\\DAT\ZIP\"
SET APath="%LDrv%\WTXDTA_ARC\DAT\ZIP\"
SET TPath=!LPath:"=!

.
.
.
.
.
>"%ScriptFull1:"=%" (ECHO open %FtpSite%)
>>"%ScriptFull1:"=%" (ECHO %FtpUser%)
>>"%ScriptFull1:"=%" (ECHO %FtpPass%)
>>"%ScriptFull1:"=%" (ECHO type binary)
>>"%ScriptFull1:"=%" (ECHO lcd "%TPath:~0,-1%")
>>"%ScriptFull1:"=%" (ECHO cd "%RPath:"=%")
>>"%ScriptFull1:"=%" (ECHO dir %Fltr:"=% "%DrFull:"=%")
>>"%ScriptFull1:"=%" (ECHO ls %Fltr:"=% "%LsFull:"=%")
>>"%ScriptFull1:"=%" (ECHO mget %Fltr:"=%)
>>"%ScriptFull1:"=%" (ECHO quit)

This script gets all the file startin with TLUS from the ftp server now i just want the files that start with TLUS2*.*,TLUS3*.* and TLUS4*.* can any one suggest me so that i can get only these 3 files in the two specified folders
 
Complicated script!

I'm guessing your FTP server can handle linux-type wildcards. If so, you could just:

SET Fltr="TLUS[234]*.*"

If not, you'll need to wrap everything, save that SET, in a loop like:

for Fltr in ( TLUS2*.* TLUS3*.* TLUS4*.* ) do (
[the other stuff]
)
 
ya i have tried the SET Fltr = TLUS[234]*.* it is able to copy to one folder and it is not archevin in another folder and not gettin del in FTP server...

also i used for loop it giving error :Fltr is not know can you specify whr exactly and should i specify in the script as i am no that good in scripting please help me out
 
Last edited:
Sorry, I'm more used to Bash syntax. Looks like batch files can't do a for loop with a variable of more than one character! So in a batch file you'll have to do:

for %%f in ( TLUS2*.* TLUS3*.* TLUS4*.* ) do (
SET Fltr="%%f"
[the other stuff]
)
 
Back
Top