You can check whether the drive is mounted by IF EXIST Z:\. This should work:
if exist z:\ (
net use z: /delete
)
net use z: \\path
You can check whether the drive is mounted by IF EXIST Z:\. This should work:
if exist z:\ (
net use z: /delete
)
net use z: \\path