I've a fairly rudimentary knowledge of batch files and usually manage to get by but have hit a problem which I can't solve.
The batch files are run on Windows 7 Ultimate and Windows 10 Professional systems and are usually invoked by a Scheduler program, although sometimes I just click the relevant desktop icon. Essentially, the role of the batch files is to download specific files (TV programmes) which are listed in an external text file, in my case, located in my Dropbox account. For each item in the text file (TV.txt) there are two lines, one naming the file, the other listing its ID:
name1
ID1
name2
ID2
name3
ID3
The batch files successively work through the items listed in the text file, one file works on the "IDs", the second on the "names".
The "IDs" file (tv-pid.cmd) consists of the following:
set $textFile="D:\Dropbox\Get_iPlayer\0-TVdl\tv.txt"
for /f "delims=" %%a in ('type %$textFile%') do get_iplayer --pid %%a
The "names" file (tv-nopid.cmd) consists of the following:
set $textFile="D:\Dropbox\Get_iPlayer\0-TVdl\tv.txt"
for /f "delims=" %%a in ('type %$textFile%') do get_iplayer --get %%a
Each batch file works well on its own, the problem is when I try to combine the two into a single batch file.
If I create a "combined" batch file (tv.cmd):
call tv-pid.cmd
call tv-nopid.cmd
the first "call" is executed but the batch operation terminates before calling the second file.
Equally if I create a "combined" batch file (not using "call" commands)
set $textFile="D:\Dropbox\Get_iPlayer\0-TVdl\tv.txt"
for /f "delims=" %%a in ('type %$textFile%') do get_iplayer --pid %%a
set $textFile="D:\Dropbox\Get_iPlayer\0-TVdl\tv.txt"
for /f "delims=" %%a in ('type %$textFile%') do get_iplayer --get %%a
the same happens, the download activity on line 2 is executed after which the batch operation terminates.
Personally I would prefer a solution based on the "call" commands, but I don't mind.