Powershell – Windows Server 2012 R2 The route addition failed: The system cannot find the file specified

powershellroutewindows-server-2012-r2

I am using a simple powershell command,(ran as Admin) as follows.

route –p add 172.30.200.0 mask 255.255.255.0 0.0.0.0 IF 28

I have done this no problem on Windows 8.1, but when I do this in Windows Server 2012 R2, I get the following error.

The route addition failed: The system cannot find the file specified.

I am a sysadmin JR, So I apologize if this is mundane, But I have no idea where to start. The few google searched I did pointed me to: This Technet Article

The route command converts destination names to addresses using the networks database file located in the (\system32\drivers\etc\networks) directory. If you add a route to the routing table, the network address of the destination name must be added to the networks database file for address resolution. For the route utility to work correctly, the gateway/network numbers must be specified in the NETWORKS file.

Am I in the right ballpark?

Thank you everyone.

Best Answer

Well, this command worked: route add 172.30.200.0 mask 255.255.255.0 0.0.0.0 IF 28 -p

The -p was throwing it off, it has to be at the end of the command for whatever reason.

Related Topic