Net use command returns 0, but does not work
Hello everyone, My problem is this: I'm running the command "net use x: \\some\share password /user:admin" (for example) and it works as expected. The problem is, when I run cmd as administrator and run the command, it says its working and everything (command completed successfully) and the exit code is 0, but I can't see the drive in Computer nor in the "net use" table. If you're wondering why I need to run it as admin it's because I run the command by a program that has to run as admin. Another interesting thing happens. When I (from the admin cmd) use "runas" to run the command as the logged in user, it adds the entry to the "net use" table but shows it as "Unavailable", and still doesn't display anything in Computer. Very confusing to me and I couldn't find anything helpful in my searches. Would love to get the help of a Microsoft professional.
November 24th, 2009 12:09pm

I'm not a Microsoft professional, but with Windows 7 I have tried to reproduce the problem you listed above exactly as you have stated it. Unfortunately I cannot... The drive connects as expected and is available to all users. C:\Windows\system32>net use x: \\XXComputerNameXX\D xxpasswordxx /user:xxusernamexxThe command completed successfully.C:\Windows\system32>net useNew connections will be remembered.Status Local Remote Network------------------------------------------------------------------------------- OKX:\\XXComputerNameXX\D Microsoft Windows Network Note that you MUST run CMD as an Administrator, because if you do NOT run the CMD prompt as Administrator it will fail with ERRORLEVEL 2as follows: C:\Users\NoelC>net use w: \\XXComputerNameXX\D xxpasswordxx /user:xxusernamexxSystem error 1219 has occurred.Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again. Have you tried running a "NET USE" immediately after the connection attempt, from within the same CMD window, and seeing what it thinks is connected?What variant of Windows 7 are you running (i.e., 32 bit/x64, Home, Ultimate, etc.)?How, exactly, are you running the CMD window? Is it by another task started on the desktop, started by the Task Scheduler, or what?-Noel
Free Windows Admin Tool Kit Click here and download it now
November 24th, 2009 6:58pm

This is a known behavior. Please see the following blog. Mapped Network Drives with UAC on Windows VistaArthur Xie - MSFT
November 27th, 2009 11:41am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics