Assuming you want to move the distance D from point 1 to point 2 :
P1 = [ X1, Y1, Z1 ]
P2 = [ X2, Y2, Z2 ]
The line vector can be described as :
V = P2 - P1 = [ Xv = X2 - X1, Yv = Y2 - Y1, Zv = Z2 - Z1 ]
The line's length can be determined as :
VL = SQRT(Xv^2 + Yv^2 + Zv^2) // ^2 = squared
The line's versor aka the unit vector can be determined as :
v = V / VL = [Xv / VL, Yv / VL, Zv / VL]
The target point PD can be determined as :
Pd = P1 + D * v // Starting from P1 advance D times v
Please note that P1 and v are vectors and D is a scalar