Re: Connecting shares automatically


Rob Westland
 

Hi Luuk,

the problem is not the command (net use) itself. The command must be executed on startup of the server in background, without any user logged in.




Op 17-3-2020 om 08:31 schreef Luuk:

Some more details:

  • First delete the connection
C:\Users\Luuk>net use r: /d
r: was deleted successfully.
 
  • Create the connection, if a password is asked, enter it:
C:\Users\Luuk>net use r: \\SERVER\SHARE
The command completed successfully.
 
  • Use WMIC to see the username that was used for this connection:
C:\Users\Luuk>wmic netuse where LocalName="r:" get UserName /value
 
 
UserName=DOMAIN\USERNAME
 
 
 
  • Delete the connection again:
C:\Users\Luuk>net use r: /d
r: was deleted successfully.
 
  • Create connection by specifying PASSWORD and DOMAIN\USERNAME from previous steps:
C:\Users\Luuk>net use r: \\SERVER\SHARE PASSWORD /user:DOMAIN\USERNAME
The command completed successfully.
 
 
C:\Users\Luuk>

Join main@magicu-l.groups.io to automatically receive all group messages.