MODEY 0 Newbie Poster

Hi Everyone,
have got this application that exports multiple files bit gives them random names,
i would like to rename all the files in the folder to the first 3 characers on the firstline then put an underscore and then the first 5 characters on the seconline

example randomfile_001.txt contain the following lines
Abc/xyz
def12/pqr

to become Abc_def12.txt
is there a way to rename in vbs or .bat
thanks alot