Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In my day to day work, I need to access data on shared folders using different credentials (my desktop account is not the same as the account I use to access these servers). Normally, I'd map a few drives and be done with it; the problem is I access 40-50 different servers on a daily basis - and it is not the same servers each day.

What I've been doing thus far is basic, and annoying - but it somewhat works. I have a folder with subfolders organizing the shortcuts to each shared folder. Each shortcut is simply a \servername\folder pointer - which I double click and am prompted to enter my credentials.

What I'd like to do is use some sort of application (or a batch file) to just launch an explorer window already pointed to the share, with the credentials already entered. While it's easy enough to create a command line shortcut to net use which maps the drive, due to the number of drives I interact with mapping a drive is out of the question.

TL;DR: Is there a way to do something like:

explorer.exe /user:domain\username /pass:Pa55w0rd! /folder:\servername\folder

and have it pop up an explorer window to that path

share|improve this question

closed as off-topic by TheCleaner, HopelessN00b, kce, Ward, Jenny D Mar 10 at 9:46

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must be relevant to professional system administration. Server Fault is dedicated to professional system and network administrators. End user and enthusiast questions are off-topic (contact your system administrator or hire a professional to help you out). Please see the Help Center for more information." – TheCleaner, HopelessN00b, kce, Ward, Jenny D
If this question can be reworded to fit the rules in the help center, please edit the question.

    
I'm confused. Are you looking for the net use command? –  MDMarra Mar 6 at 23:12
    
Net use is the correct command, or you can use the new-psdrive command in Powershell (requires 3.0, enter $psversiontable at the prompt to determine what version you are running). –  Davidw Mar 6 at 23:54
    
Welcome to Server Fault! Questions must be relevant to professional system administration. Server Fault is a site dedicated to professionals; novice questions are off-topic as are questions related to home or personal use scenarios. Please see the Help Center for more information on topicality. –  TheCleaner Mar 7 at 0:52
    
I'm familiar with net use, if you read my comment you'll note that I specifically cannot use the net use command. I'm trying to simply open an explorer window to the specified path with credentials, there are too many (and they change too often) to mount as a network drive. –  kagaku Mar 7 at 14:30
1  
@kagaku I think you're not 100% clear on all of the options with net use. You don't need to map a drive with it. You can simply specify alternate credentials with the UNC path –  MDMarra Mar 7 at 14:35

1 Answer 1

up vote 6 down vote accepted

It seems like you've missed an important part of net use before you ruled it out as a solution. You don't need to specify a drive letter with it.

net use \\server\share /user:test /password:test will work just fine. You don't need to specify a drive letter. This will allow access to that UNC path under the specified credentials.

Once you have the UNC path available under alternate credentials, you can launch an explorer session to the UNC path manually or by using start.exe as in start \\server\share.

A little two-liner as an example would be

net use \\server\share /user:test /password:test
start \\server\share
share|improve this answer
    
You're right, I wasn't aware that drive letter was optional. Thank you for explaining, this is exactly what I was looking for. –  kagaku Mar 7 at 15:41

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