Can it be done without using a software like universal g-code sender?
Yes, you can write a custom g-code sender application.
If so, which is the right way?
Get busy writing.
Though what improvements you could make on the universal g-code sender, having to ask these questions, I can not imagine.