Windows 7 net use mapping error

Good Day to all,

I am new to Windows 7 and we are deploying our first Windows 7 box. The problem is a dos script that our accounting dept uses to connect to a server share will not work in Windows 7. Now the issue is two part. 1. It works in XP on multiple pc's. 2. It is a very simple script using net use. Here is the script:


When I run it I get a System Error 5   Access is denied.

I have tried running this using the Run as administrator command with the same results.
I even tried logging in as the domain admin and using run as administrator.

Additional notes. If I open my computer and use the Map Network Drive option I can map to the share. If I right click on it and choose disconnect and then run the script using run as administrator it works. I know it is probably something easy. But I really need to get this to work I don't know what is so different in the way that Windows 7 is running this script but any help would be greatly appreciated
Who is Participating?
lucifer82Connect With a Mentor Commented:

if the share is outside the network in the domain section you just need to enter the ip

eg. if the server or pc that has the share has ip of

then username should be\USERNAME PASSWORD

Windows 7 is very picky about user credentials.
if you go to the command line and manually enter that in does it work?
also try using the quotes as in this syntax:

 NET USE [driveletter:] "\\ComputerName\ShareName"

also are you including the domain int he username?

below is the proper syntax

 NET USE [driveletter:] \\ComputerName\ShareName[\volume] [password | *] [/USER:[domainname\]username]

more here:
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

POB-IT-DEPTAuthor Commented:
No it does not. Also Tried launching the command prompt by right clicking on it and choosing run as administrator. Still didn't work.
POB-IT-DEPTAuthor Commented:
The server is at a remote location outside our network, that why I use the IP address, so I cant really do the domain name thing.

As far as the quotation marks that did not work either. The sharname\directory structure doesn't have any spaces in the name.
POB-IT-DEPTAuthor Commented:
This did the trick. Just for anyone who needs it this was the final script with certain pieces of information changed to protect the innocent.

NET USE H: \\\Folder\Share /USER:\username password

Thanks for all the help!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.