Pass unc username and password with unc path

Is it possible to pass the unc username and password with unc path

like how ftp and smb support this



I am trying to get a (non domain pc) service access to DFS path.

Is there another way around this? Yes I could bind the PC to the domain and run the service as a domain user but what if I was using linux ?
Who is Participating?
David Johnson, CD, MVPOwnerCommented:
for unc's windows uses the net use command
net use * \\computername\sharename\volume password /user:domainname\username
user can also be /
visualjazzAuthor Commented:
Don't want it as a drive map - I need to run a service.
David Johnson, CD, MVPOwnerCommented:
where does the service reside?  

if on your machine then you need to run that service as a user with appropriate permissions that can access the unc share
if it is on another machine one solution is to get psexec from sysinternals
psexec \\computername  -u username -p password program arguements
You cannot do this with a UNC path. Even IE6 (maybe IE7?) disallowed it years ago, where you could no longer include the username/password in the URL... Closest thing is the first comment by ve3ofa, where you can authenticate using Net Use (without a drive mapping)....

net use (insert path here) password /user:domainname\username \

This does NOT create a mapping, only authenticates to the resource....

Im glad we could answer your question. FYI, I have requested assistance to have this thread reopened and split, as I was only trying to add on to your comment ve3ofa....
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.