Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to map a network drive to my machine and I'm using net view \computename but I'm getting the "Access is denied" message.

How do I provide the username and password to the net view command without using domain and this username? Should I use my computername's username and password or my machine username and password?

share|improve this question

migrated from stackoverflow.com Feb 11 '11 at 15:31

This question came from our site for professional and enthusiast programmers.

add comment

2 Answers 2

up vote 1 down vote accepted

This worked for me:

net use \\server\IPC$

net view \\server

Once you connect to IPC$ (or any share, in fact), Windows will reuse the same credentials (or even the same TCP connection) for all other operations.

(IPC$ is a system share that exists on all CIFS/SMB servers, therefore it's guaranteed to work.)

share|improve this answer
    
Thanks @Grawity only one doubt i wanna to clear is like am trying to share Linux machine folder on windows machine ,username and password is of windows machines or of Linux's machine user name and password –  AMIT Feb 12 '11 at 21:47
    
@AMIT: Of the machine you are connecting to. –  grawity Feb 12 '11 at 22:17
    
did you remove how to create credentials on windows?? –  AMIT Feb 14 '11 at 6:11
    
@AMIT: Yes. Want it back? (Also try net use ... /savecred) –  grawity Feb 14 '11 at 9:12
    
Thanks @Grawity for share it again –  AMIT Feb 15 '11 at 6:30
add comment

You cannot do this for the net view command, only for net use:

net use \\server\share /user:AMIT

However, you can add the username/password to Windows' Credential store. This will make Windows use that password for all connections to your specified server, whether you make them with net view, net use, or Windows Explorer.

  • In Windows XP, open Control Panel → User Accounts → Manage my network passwords (alternatively, Start → Run → rundll32 Shell32.dll,Control_RunDLL keymgr.dll). Click Add.

    Adding a server

  • In Windows 7, Control Panel → User Accounts → Manage credentials. Click Add a Windows credential.

share|improve this answer
    
THANKS @Grawity for your response but i don't folder is shared on server , and i want to use net view command to see which folder is shared now am getting permission denied ,then how do i see the shared folder on server –  AMIT Feb 12 '11 at 14:40
    
@AMIT: Tell Windows your password as described in the second part of my answer. Then try net view. –  grawity Feb 12 '11 at 15:50
    
@AMIT: See my second answer for a different method I just remembered. –  grawity Feb 12 '11 at 16:07
    
still getting System error 5 has occurred. Access is denied. –  AMIT Feb 15 '11 at 6:39
    
is it sumthing am missing in samba conf file?? –  AMIT Feb 15 '11 at 6:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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