Solved

vista: how to change ip address through command prompt?

Posted on 2008-10-12
9
3,102 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
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…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

911 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

23 Experts available now in Live!

Get 1:1 Help Now