\192.168.1.1
is invalid address for network share. Have you tried \\192.168.1.1
?
And in both cases you should escape that \
and write the address as a proper string with quotation marks.
Also, \\192.168.1.1
alone is not "a valid folder", you have to specify one of the network shares under this IP address.
That being said, you should use opendir("\\\\192.168.1.1\\share")
.