Yeah, I know - I'm trying to get away from running seperate routines for different OS's and find a non OS specific command. Using the NET::grpnetworks does what I am trying to do - just got it to work now. Thanks all.
Just thought I would mention GRPNETWORKS doesn't actually give you the default IP gateway - it does do what I was attempting (in a roundabout way) to do.
Just to clarify which I didn't really have time to do yesterday. GrpNetworks Doesn't actually give you the gateway of the machine. It actually replaces about 4 steps of the program - one of which is getting the gateway. :)
Runs loads faster than what I had written too (big surprise)