Hi all...

I have 4 PCs in a LAN with Windows XP Professional that logon to a domain... The problem is that, to access shared files on another PC, one has to enter the username and password of the other user.

How can I use file sharing on a domain without prompting for username/password?

Thanks in advance.

Dani AI

Generated

Short answer for : the prompt appears because the credentials your client is presenting are not acceptable to the remote machine. That happens when the target PC isn’t in the same domain or doesn’t grant access to the account you’re logged in with, when cached/alternate credentials conflict, or when Windows is forced to ask because it would otherwise have to use a different username to reach the same SMB server.

Practical, ordered steps to fix it (try them in order):

  • Confirm domain membership and logon type: every PC that should accept domain credentials must be joined to the same domain and you must be signed in with a domain account that has permission on the share.

  • Verify permissions: set the share AND the NTFS folder permissions so the domain user or a domain group can read/write as required. Test with a controlled "Everyone: Read" just to confirm and then tighten permissions.

  • Clear conflicting connections/credentials: Windows will refuse multiple simultaneous connections to one server with different credentials. Remove stored or active connections before trying alternate credentials. Useful commands:

    net use \\ServerName\Share /delete
    net use Z: \\ServerName\Share /user:DOMAIN\Username * /persistent:no
  • If you still get prompted, clear cached network passwords (Stored User Names and Passwords / Credential Manager) on the client and try mapping again.

  • Check domain auth basics: time skew breaks Kerberos (clocks should be within a few minutes), and Event Viewer on the server will show failed logon reason codes.

A quick caution tied to earlier replies: turning off security or exposing shares to everyone may stop the prompts (as noticed) but is insecure. Use domain accounts/groups and correct NTFS/share rights for a safe, prompt-free experience. For centrally managed mapping, deploy drive mappings via Group Policy (target domain groups) rather than weakening share security.

Recommended Answers

All 3 Replies

I never set any security on the folders I wanted to share across the VLAN so it bnever asked for any credentials.

1 you would ahve to remove the security from each computer. or if u manager all computer from one server you can set group policies to allow access to each user to access any computer.

The WNetAddConnection API is used to connect to a shared folder and map it to a local drive. If you don't pass a local name to the function, the shared folder is connected but not mapped to a local drive. Once the shared folder is connected, copy the files to the shared folder and then disconnect it by calling WNetCancelConnection.

Declare Function WNetAddConnection Lib "mpr.dll" _
Alias "WNetAddConnectionA" ( _
ByVal lpRemoteName As String, _
ByVal lpPassword As String, _
ByVal lpLocalName As String) As Long


Declare Function WNetCancelConnection Lib "mpr.dll" _
Alias "WNetCancelConnectionA" ( _
ByVal lpName As String, _
ByVal fForce As Long) As Long

Ref:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.