Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running in a non-admin account on my development workstation, using "Run as..." for all things that need administrator privileges. Thankfully under XP even the control panel applets allow that. This doesn't seem to work however (or I simply haven't found out how, yet) for network connection settings. Say I want to temporarily change the IP address of an adapter, what would be the easiest way to open the properties page for the network connection with full privileges, without logging in as another user (fast user switching is disabled)?

Edit:

I'm looking for a solution working on Windows XP (64), where ncpa.cpl does what I want, but seems to just open an Explorer window when started from an Administrator cmd while logged in as a limited user.

share|improve this question

closed as off topic by sysadmin1138 Jul 10 '11 at 23:30

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

    
I'm not bashing you but I'm always a bit wary of this type of question. We all care about securing our systems and this obviously entails knowing about exploits/hacks etc. but I think there's a discussion to be had about whether the site should expressly detail these weaknesses. –  Chopper3 May 7 '09 at 11:28
    
Sorry, I don't understand your comment at all. What I want to do needs the password to an account with sufficient permissions - I just want to skip the log out - log in as this user - log back in as me cycle. How is doing anything using "Run as" connected with exploits or hacks? –  mghie May 7 '09 at 11:33
    
Mghie, ncpa.cpl doesn open just an Explorer window, it opens your "Network Connections". You do not need to start it from an admin cmd, you can got to your system32 directory, find it, right click on it, "Run as..." the elevated user (whatever that might be) and you get the "Network Connections" windows, where all your network connections reside. –  user1797 May 7 '09 at 11:56
    
Please have a look at img209.imageshack.us/img209/4622/ncpaproblem.png. First I started it as limited user, which you can see from the little locks in "Network Connections". The second attempt failed, the third (as Administrator) gave me the Explorer window as shown. I'm stumped. –  mghie May 7 '09 at 12:10
    
Can you try running the "cmd" as admin, and just typing "control ncpa.cpl" on the elevated prompt? –  user1797 May 7 '09 at 12:18

3 Answers 3

up vote 2 down vote accepted

Try the runas with the following:

explorer.exe /n,::{7007ACC7-3202-11D1-AAD2-00805FC1270E}

Post back the behavior, please. Aha! This explains why it doesn't work. I did not realized the user I was testing with was part of the Administrators group (totally my fault). Extract from the link:

"In the system32 folder, the file properties of ncpa.cpl show that it is the “Network Connections Control-Panel Stub”. So why doesn’t RunAs work with Network Connections? Because that stub merely calls the ShellExecuteEx API to launch an item in the shell namespace, which appears as a folder within Explorer."

The cmd scripts files he refers to there, which are not longer available, can be found on this wiki.

share|improve this answer
    
Thanks for the link, I'm reading and trying out now, but still it doesn't work completely as advertised. Maybe it's the XP 64? Anyway, thanks for persisting with this, I will mark an accepted answer when I have it working both on XP 32 and XP 64. –  mghie May 7 '09 at 15:04
    
All is well: It does work exactly as advertised, with minor cosmetic glitches - the network connection symbols don't react on double clicks, and they still have the little "Locked" symbol superimposed, that's what led me to believe it was still not working. However, choosing Properties in the context menu opens a completely functioning page, all options enabled. Thanks a lot, the links to the incredible blog post and the scripts made me accept this for the answer. –  mghie May 7 '09 at 15:16

You should be able to just runas "Control" if you've set Explorer to launch new folder windows as separate processes.

Then you can just hit whatever item inside it and it should start as that user... there might be a way to force this if you don't have "launch folders as separate processes" by using explorer.exe and its argument /separate

share|improve this answer
1  
Thanks for the tip, +1, I will mark an accepted answer when I have it working both on XP 32 and XP 64. –  mghie May 7 '09 at 15:04

You can use netsh from the command line to change IP, modify DNS, etc. Examples:

To change default gateway and IP:

netsh int ip set address "Local Area Connection" static 10.100.100.10 255.255.255.0 10.100.100.254 1

Changing DNS:

netsh int ip set dns "Local Area Connection" static 10.100.100.20 primary

Change from static to DHCP:

netsh int ip set address "Local Area Connection" dhcp

You run those from an elevated command line. The examples above assume the network adapter is "Local Area Connection" (change this accordingly).

You can read more about netsh at Microsoft.

NOTE: I believe you can use ncpa.cpl (under system32) to call the Network Connections "folder". This is what you are looking for.

share|improve this answer
    
Thanks for the tip, +1. That's great for scripts. It looks a little overwhelming for casual use though, any idea how to get to the "normal" properties page? –  mghie May 7 '09 at 11:30
    
I am close to find it. I know that the Control Panel network extension is netcpl.cpl, but it is not found on my XP VM (I run Windows 7 now). I am still researching and will post back. –  user1797 May 7 '09 at 11:32
    
Amended my note to add ncpa.cpl. That is your answer, I believe. –  user1797 May 7 '09 at 11:36
    
I'm on Windows XP 64. Entering ncpa.dll in an administrator cmd.exe opens an Explorer window with the root of the system drive (C: in my case). It can't even be started on 32 bit XP without a full path, but then it shows the same Explorer window :-( –  mghie May 7 '09 at 11:43
    
It is ncpa.cpl, not .dll. –  user1797 May 7 '09 at 11:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.