Jump to content
Sign in to follow this  
nlgma

Static IP address

Recommended Posts

nlgma

I'm sure it's a simple little 20 lines code script, But I was wondering if someone had some code sitting around. I need a script that keeps a uses pc with the same static IP. I plan on running the script as a windows service.

Share this post


Link to post
Share on other sites
Fossil Rock

I'm sure it's a simple little 20 lines code script, But I was wondering if someone had some code sitting around. I need a script that keeps a uses pc with the same static IP. I plan on running the script as a windows service.

Why wouldn't you just set the IP to static and be done with it ?

Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Share this post


Link to post
Share on other sites
nlgma

Why wouldn't you just set the IP to static and be done with it ?

The users keep renewing their IP or manually changing it.. If I can't stop the user from releasing it or changing it. Then I was hopping to use a script that monitors the IP for change and sets it back to static and to the IP address I assigned it.

Share this post


Link to post
Share on other sites
Fossil Rock

The users keep renewing their IP or manually changing it.. If I can't stop the user from releasing it or changing it. Then I was hopping to use a script that monitors the IP for change and sets it back to static and to the IP address I assigned it.

Is there a reason why it matters if it gets changed?

Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Share this post


Link to post
Share on other sites
nlgma

Ok, My mom is not the smartest when it comes to computers, I have a opened a port on the router to VNC into her computer. Her Comcast goes down every other day and when she calls them to fix it. They set her up with DHCP enabled. booooo....... No mom! Your on a static IP!, call me be for you call them.... Yeah I've said that 4 or 9 times now. I'm almost done with the script.

Share this post


Link to post
Share on other sites
Fossil Rock

Ok, My mom is not the smartest when it comes to computers, I have a opened a port on the router to VNC into her computer. Her Comcast goes down every other day and when she calls them to fix it. They set her up with DHCP enabled. booooo....... No mom! Your on a static IP!, call me be for you call them.... Yeah I've said that 4 or 9 times now. I'm almost done with the script.

Both computers on a local network? If so, you should be able to connect to her computer with the machine name as opposed to the IP address. Another thing you can do is turn off DHCP in the router and assign static IPs.

Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Share this post


Link to post
Share on other sites
covaks

You could reset network settings with netsh, or with WMI. For an example on disabling DHCP and setting ip info with WMI Click here

Share this post


Link to post
Share on other sites
Nevin

If the router is telnet capable, you could just telnet into her router from wherever you are, right?

Share this post


Link to post
Share on other sites
cyberworm

Just make the router give the computer the same IP Address all the time. Boom done

Share this post


Link to post
Share on other sites
nlgma

I'm unable to telnet in to the router or make the router give the computer the same IP every time. I did learn about NETSH, Very nice command. I wrote a script the monitors her IP for change, if it changes then "netsh interface ip set address "Local Area Connection" static 192.168.0.10 255.255.255.0 192.168.0.1 1". It works.

Share this post


Link to post
Share on other sites
Fossil Rock

I'm unable to telnet in to the router or make the router give the computer the same IP every time. I did learn about NETSH, Very nice command. I wrote a script the monitors her IP for change, if it changes then "netsh interface ip set address "Local Area Connection" static 192.168.0.10 255.255.255.0 192.168.0.1 1". It works.

What's the brand and model number of the router?

Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.