Solved

vista: how to change ip address through command prompt?

Posted on 2008-10-12
9
3,101 Views
Last Modified: 2010-08-05
hello,

i just want to know... i'm using microsoft vista rite now and wonder; how to change my ip address by using command prompt. can anyone give me the line of codes?
0
Comment
Question by:crackmonks
  • 4
  • 4
9 Comments
 
LVL 4

Expert Comment

by:MikeSel
ID: 22697025
Change it? Do you mean set it statically? Or use

ipconfig /release
ipconfig /renew

to get a new DHCP assigned address?
0
 

Author Comment

by:crackmonks
ID: 22697072
uurrmmm... actually, i found the term 'change' from articles which i read via the internet and most of them suggest me to use:
ipconfig/flushdns
ipconfig/release
ipconfig/renew

i used the technique suggested but it didn't work. i guess, maybe the command only for xp. if yes, how about vista?
0
 
LVL 77

Accepted Solution

by:
Rob Williams earned 50 total points
ID: 22697632
If the DHCP lease has not expired withe the DHCP server/router you will simply be reassigned the same IP with ipconfig.

Is the DHCP server on your local network or with an ISP.
If you wish to change on a local network you are best to assign a static IP either through the graphical interface [ manage my network connections | right click on the adapter and choose properties | highlight TCP/IP ver 4 and choose properties | here you can set the IP configuration].
You can also do so at a command line with (sample values):
netsh interface ip set address name = "Local Area Connection" source = static addr = 10.0.0.99 mask = 255.255.255.0
netsh interface ip set address name = "Local Area Connection" gateway = 10.0.0.254 gwmetric = 1
netsh interface ip set dns name = "Local Area Connection" source = static addr = 4.2.2.2
netsh interface ip add dns name = "Local Area Connection" addr = 4.2.2.3

If the DHCP server is the ISP's, you can only change your IP by changing your MAC address, that of the PC (often not possible) or your router's MAC. When the connection is refreshed you will be assigned a different IP.

Why is it that you wish to do so?

0
 

Author Comment

by:crackmonks
ID: 22697840
actually, i found an article discussed about how to use rapidshare without paying for the premium member. I didn't interested with that. I was only interested with the IP swicther technique because i had an idea with that. My idea needs the command prompt lines because I wanna use .bat file. My .bat file worked only on XP but not Vista. That's why I would like to ask for some helps :)
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 77

Expert Comment

by:Rob Williams
ID: 22697869
The netsh commands above are intended for use with a batch file. Though ipconfig release and renew can also be used in a batch file (including Vista), as mentioned in most instances you will be reassigned the same IP.
0
 

Author Comment

by:crackmonks
ID: 22697900
again, tested! and i faced the same problem... i don't know whether this is basic or what... but the problem is this appeared

"The requested operation requires elevation".

how can this happen and how to fix it? any idea?
0
 
LVL 77

Expert Comment

by:Rob Williams
ID: 22697966
It can only be run as an administrator with Vista.
If you are running from a command line go to all programs | accessories | right click on the command prompt and choose run as an administrator. Simply being an admin of the machine is not enough.
You can also do so by enter in in the search box  cmd  and press ctrl+shift+enter to start a command window with administrator (elevated) privileges. Either way you will see "administrator" on the menu bar.
0
 

Author Comment

by:crackmonks
ID: 22698009
Thanks a lot for your help. actually, i'm still stuck and i think this gonna be a long discussion if i keep asking questions where the answers can be found via mr.Google. TQ RobWill. I really appreciate your help ;)

ps: and you too MikeSel :)
0
 
LVL 77

Expert Comment

by:Rob Williams
ID: 22698042
OK. Thanks, and good luck with it.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Hi All Just a quick one for everybody. I was recently looking into setting the default User Account Picture for all my vista clients within the network but on closer inspection the group policy setting only allows you to set the default pictur…
So who is this article for? If you are like most of the computer users out there, you probably only realize the meaning of 'System maintenance' after something goes wrong. This article is for you if you care about keeping your system working opti…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now