Solved

vista: how to change ip address through command prompt?

Posted on 2008-10-12
9
3,117 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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
 
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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The main issue when installing Vista and XP in dual boot is when you have to reinstall any of the two when something fails, let's say a hard disk failure, a lost partition, virus, etc. What commonly happens is that you lose all your hard work config…
I'm a big fan of Windows' offline folder caching and have used it on my laptops for over a decade.  One thing I don't like about it, however, is how difficult Microsoft has made it for the cache to be moved out of the Windows folder.  Here's how to …
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

628 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