<s>[INST] Line L intersects perpendicularly both the lines $\frac{x+2}{2}=\frac{y+6}{3}=\frac{z-34}{-10}$ and $\frac{x+6}{4}=\frac{y-7}{-3}=\frac{z-7}{-2}$ A straight line L intersects perpendicularly both the lines $\frac{x+2}{2}=\frac{y+6}{3}=\frac{z-34}{-10}$ and $\frac{x+6}{4}=\frac{y-7}{-3}=\frac{z-7}{-2}$,then square of the perpendicular distance of origin from L is ?

Let $\frac{x-x_1}{l}=\frac{y-y_1}{m}=\frac{z-z_1}{n}$ be the required line.
Then $2l+3m-10n=0,4l-3m-2n=0$
So $l:m:n=1:1:\frac{1}{2}$
So the line is $\frac{x-x_1}{1}=\frac{y-y_1}{1}=\frac{z-z_1}{\frac{1}{2}}$.
But i could not solve further.Please help me.
 [/INST] Broad Steps
(1) We have the dr's of the two given lines
(2) Let P & Q be points on the two lines so that PQ is the shortest distance. 
Find equation of L through PQ 
(3) Find distance of L from origin.
Details
Note that $\color{blue}{(2,3,-10)}$ and $\color{blue}{(4,-3,-2)}$ are direction ratios of the 2 given lines.
Let $P(2r_1-2, 3r_1 -6, -10r_1 +34)$ and $Q(4r_2-6, -3r_2 + 7, -2r_2 +7)$ be the points on the given lines so that $PQ$ is the line of shortest distance between the two lines.
The direction ratio's of $PQ$ are $(2r_1 - 4r_2 +4, 3r_1 + 3r_2 - 13, -10r_1 + 2r_2 +27)$
Since it is perpendicular to the 2 given lines, we will have 
$$\color{blue}{2}(2r_1 - 4r_2 +4) + \color{blue}{3}(3r_1 + 3r_2 - 13) \color{blue}{-10}(-10r_1 + 2r_2 +27) = 0$$ and
$$\color{blue}{4}(2r_1 - 4r_2 +4) \color{blue}{-3(}3r_1 + 3r_2 - 13) \color{blue}{-2}(-10r_1 + 2r_2 +27) = 0$$
These simplify to $113r_1 - 19r_2 - 301 = 0$ and $19r_1 - 29r_2 + 1 = 0$ which gives $\color{blue}{r_1 = 3, r_2 = 2}$
So we now have $P(4,3,4)$ and $Q(2,1,3)$ and direction ratios of $PQ$ as $2,2,1$
Finally, the equation of the line through $PQ$, or line $L$ is 
$$\color{blue}{\frac{x-4}{2} = \frac{y-3}{2} = \frac{z-4}{1}}$$
The square of the distance of this line from the origin can be deduced using standard formulae.
However, in order to complete the solution, we can do the following: $(2r +4, 2r + 3, r +4)$ is any point on this line $L$. The square of its distance from the origin is clearly $(2r+4)^2 + (2r+3)^2 + (r+4)^2 = 9(r+2)^2 + 5$ which is minimum when $r = -2$ and the square of the distance is then $\color{blue}{5}$
</s>