I am using a batchscrip to run at logon on my server 2012 essentials Domain Controller...
The script breaks down into 3 sections
- Connects to 2 folders in local PC share
- Connects to remote ip (wan ip) server shares
- Connects to local up (lan ip) server shares...
This works great however ideally I would like it to do on or the other of the bottom steps, so connect ideally first by using the local server IP, and if this fails as a fall back connect using the
@echo off
:DELETE
net use /delete * /y
:SHAREA
NET USE u: "\\ComputerIP\Documents" /user:user password
GOTO SHAREB
:SHAREB
NET USE v: "\\ComputerIP\Documents\Guest Documents" /user:user password
GOTO SHAREC
:SHAREC
NET USE w: "\\RemoteIP\Company\Documents"
GOTO SHARED
:SHARED
NET USE x: "\\RemoteIP\Company\Documents\Guest Documents"
GOTO SHAREE
:SHAREE
NET USE y: "\\localIP\Company\Documents"
GOTO SHAREF
:SHAREF
NET USE z: "\\localIP\Company\Documents\Guest Documents"
GOTO EOF
:EOF