1

Permanently mount network share without the need for log on? (Windows)

the above almost worked for me. But I have ran into an issue,

I am able to get the share drive mapped as stated above using "PsExec.exe -i -s cmd.exe"

under nt authority\system.

net use x: //server/share password /user:domain/username /persistent:yes

As you can see I am using a different credential to map the drive, the command works successfully and I can the view the drive from the current invoked CMD.

But if try to open the drive via gui or from a normal command prompt I get

The user name or password is incorrect

any suggestions?

2 Answers2

0

If you log in to your GUI, you are in a user session and no longer "nt authority\system". Think of them as two completely different users with completely different drives. The user will have to mount the drive by himself (using autorun, netlogon, scripts or a GPO).

If you want to use that drive as UserA, you'd have to mount it a UserA. UserB will no see that (even if it's username is 'system').

Also: Use proper backslashes (\) while working under windows, that will make your life easier.

bjoster
  • 4,423
  • 5
  • 22
  • 32
-2

You are just using slashes but sometimes backslashes are required:

net use x: \\server\share password /user:domain\username /persistent:yes

Also: if you plan to use this is a domain environment, consider using Group Policy Preferences. It is far more reliable.

duenni
  • 2,939
  • 1
  • 22
  • 38