views:

438

answers:

1

I need to add a route into the IP4 routing table on windows xp.

However, the Win32_IP4RouteTable class seems to only be able to query existing routes.

Basically I need the same functionality as:

route ADD 192.168.127.254 MASK 255.255.255.255 192.168.1.10

Is it possible to use WMI to add an entry into the IP4 routing table?

Could I use CreateProcess instead?

+1  A: 

Do you need solution on WMI only? I usually use IPHelper. Specifically, you need CreateIpForwardEntry function.

Alexander
+1 Magic, thanks. I'd forgotten about IPHelper and I'd actually prefer to use it because all that COM WMI code makes me feel quesy. Now, I don't know what the S.O. etiquette here is - you've solved my problem but not answered the question!
markh44
I'm new here too, so I don't know either...
Alexander
Sod it, you solved the problem I'll accept it as the answer. It doesn't seem like there's any other answers forthcoming anyway!
markh44