Command Prompt - Accessing "Access is Denied" folder

3

1

Note: I'm on a Windows computer using command prompt.

A network exists where there is a single drive (let's call it C:) and there is a folder for every different user account inside of this drive. For example, a few directories might be C:\John, C:\Steve, and C:\Bob. I am logged into the Bob account on the network (I logged into it from the initial log-in page when the computer is turned on). When I navigate to the C: drive in command prompt and attempt to use the command: cd John, Access is Denied is returned. If I had John's username and password for the network, is there a way I could use a command (like: cd John [username] [password]) or something like that? Or would I need to log off my current account, log into the computer with the John information and then navigate to the directory to view the folder?

Zach Brantmeier

Posted 2014-05-03T02:29:01.097

Reputation: 343

If this was on a single machine, I would say that you could run Command Prompt using UAC with John's account if John's account had elevated privileges, but I'm unfamiliar with how exactly this works in network settings. If it's a network drive, you could also map it using John's credentials instead of Bob's. Other than that, I don't have much of an idea. – Pockets – 2014-05-03T02:50:37.863

Answers

2

Using command prompt:

NET USE X: \\SERVERNAME\SHARENAME PASSWORD /USER:USERNAME

OR

NET USE X: \\SERVERNAME\SHARENAME * /USER:USERNAME

Will prompt for password and will not show it when you type it

Drive X: will be mapped to the shared folder SHARENAME in SERVERNAME

When you are done:

NET USE X: /DELETE

If the network folder is already mapped by you, unmap it first:

NET USE X: /DELETE

Carlos Alloatti

Posted 2014-05-03T02:29:01.097

Reputation: 33

If the drive is already mapped by gpo this may have issues. you may have to run some complex runas/cmd trickery to get a cmd prompt to work for the stated purpose. I dont have any of the cmd info with me but can provide if needed – Kendrick – 2014-05-03T04:20:59.263

If the resource is already mapped, it can be unmapped first, edited the answer to account for it. – Carlos Alloatti – 2014-05-05T13:50:33.197

-1

Couple suggestions to open a command prompt as John:

Ctrl+Shift+Right-click a command prompt shortcut, choose "Run as different user", and then provide John's credentials.

or

Use runas /user:domainname\John cmd, then enter John's password when prompted.

or

Use PSexec:

psexec /u domainname\john cmd, then enter John's password when prompted.

Ƭᴇcʜιᴇ007

Posted 2014-05-03T02:29:01.097

Reputation: 103 763