473,888 Members | 1,583 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Issue of changing IPAddress programatically in windows vista

1 New Member
My requirement is to change the IP Address of local system programatically using .net.
IP Address should change to, subnet mask =, default gateway=10.1.2. 1

I have created a small C# Console application in Visual Studio 2005 which change the IP address of the local system. I execute the following batch file using Process.Start(" ipchange1.bat") ;

Content of batch file is:

set path=c:\Windows \System32
netsh interface ip set address name="Local Area Connection" static 1

The above application is not working in Vista. It showed the error message as "The requested operation requires elevation".
To solve this error I added a new file to the project entitled ipApplication.e xe.manifest
<?xml version="1.0" encoding="UTF-8" standalone="yes "?>
<assembly xmlns="urn:sche mas-microsoft-com:asm.v1" manifestVersion ="1.0">
<assemblyIdenti ty version="1.0.0. 0" processorArchit ecture="X86" name="ipApplica tion" type="win32"/>
<trustInfo xmlns="urn:sche mas-microsoft-com:asm.v3">
<requestedPrivi leges>
<requestedExecu tionLevel level="requireA dministrator"/>
</requestedPrivil eges>

I embeded the manifest into my executable by adding the below code in Project Properties -> Build Events -> Post-build event command line

"$(DevEnvDir).. \..\SDK\v2.0\bi n\mt.exe" -manifest "$(ProjectDir)$ (TargetName).ex e.manifest" –outputresource :"$(TargetDir)$ (TargetFileName )";#1

when I click on the generated exe file in bin/Debug it is working fine, but I need to run this application at the end of the installation of a setup package. I added the exe file in Commit part of Custom Action.

At the end of installation I got an error 2869.

I solved the issue by getting help from this link:
http://hunter555.blogs pot.com/2007/02/installer-error-code-2869-msi-and-uac.html

The program is working fine at the end of installation but, It is changing the IP Address abnormally
The changed IP Address is, Subnet Mask=255.255.0. 0, Default Gateway=10.1.2. 1

I don't know how to proceed further can anyone guide me with the above issue or do anyone have an alternate solution??

Need your kind support

Thanks and Regards,
Mar 6 '08 #1
1 2010
1 New Member
can u do this for windows xp?
Apr 6 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

by: PHLICS_Admin | last post by:
Hi All, There are two network cards in one computer (named A) , and there is one network card in another computer(named B). On computer A: one network card is used to connect to internet, and the other network card is used in intranet whose ipaddress is On computer B: the network card's ipaddress is These two computer can connect to each other.
by: Nick via .NET 247 | last post by:
I have a similar problem trying to use web services with awindows form application. I currently use a static web referencein my project. What I am trying to do is to programaticallychange the url based on a server name passed in, and whether ornot the PDA is in the active sync cradle. IE. If the PDA is in the cradle, use localhost. If the PDA isn'tin the cradle, then allow connection over wi-fi to any validwebservice by changing the computer...
by: Sisnaz | last post by:
I have 2 computers running with Windows Vista (final). One system where I upgraded from XP and the other as a fresh install. My executables run without issue on the system where I upgraded from XP. The other system gives me an error of Access Denied when it tries to run this code: If Process.GetCurrentProcess.ProcessName.ToLower() = "devenv" Then Exit Sub It appears the Process class is giving me grief on this Vista installation.
by: j2ee.singh | last post by:
Hi, I'm looking to buy a new laptop primarily to learn & practice .NET and C#. My Question is: Is there any requirement for .NET and C# in terms of the following Operating Systems: - Windows Vista Home Basic - Windows Vista Business
by: JamesB | last post by:
Hi all. I have a Winforms app that installs a service programatically (as opposed to using InstallUtil). If UAC on Vista is disabled, it works fine. Likewise, if the program is started by right-clicking and picking "Run as Administrator" it works (if UAC is enabled), but neither option is ideal. I suppose really I want UAC to pop up it's "do you want to allow this to happen" box when my code does its thing. Can anyone point me in the...
by: Martin | last post by:
I have the following code being used in several of my PHP scripts (it's in an include file). It opens a socket connection to a process that's running on the same computer that IIS/PHP is running on. The OS is Windows XPPro. This all works fine - no problems. $portnum = 1001; $address = $_SERVER; $socket = @fsockopen($address, $portnum, $errno, $errstr, 2);
by: Oriane | last post by:
With IIS7 on Vista SP1, the problem does not occur. When I told you yesterday that the problem occurs on Windows XP/Vista, I talked about the client environment.
by: =?iso-8859-1?B?S2VyZW0gR/xtcvxrY/w=?= | last post by:
Hi, well i had no need for it until today, so how can i bring up the "Backup and Restore" Dialog in Vista? In W2K and XP its still ntbackup.exe but with vista it changed to something like a explorer call with some parameters like: C:\Windows\explorer.exe "C:\Windows\Explorer.exe" /separate,/idlist,:49284:4224,C:\Users\devteamkg
by: JamTech | last post by:
The Script Resource and the Web Resource files are generating intermittent errors in my application. I have been trying to chase the cause of the problem but to no avail. I notice that the “d” parameter that is passed is some how corrupted and I can’t for the life of me figure out what’s causing this parameter to be corrupted. I noticed that JavaScript code that in my application is some how getting intertwined with the hash code that’s...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.