Hey all,
I was wondering if anyone could help me with a little project my boss gave me.
He wants me to write a .bat file that will silently unmount and remount a network drive.
this is the example he gave me. @echo off
net use * / delete /yes net use s: unc path /user: username password
but it doesn’t seem quiet right. which he has a history giving wrong information lol.
can anyone help me with this one?
thank you.
Note last version technique as mapped drive is variable being declared then when unmapped being cleared from dim declaration
Dim =
'dim =
The spaces are significant. You created a variable named (enclosing single quotes added to show location of space) ‘location ’ with a value of ’ “bob”’.
If you want quotes in your value, then your code should look like
set location=“bob”
If you don’t want quotes, then your code should look like
set location=bob
Or better yet
set “location=bob”
The last syntax prevents inadvertent spaces from getting in the value, and also protects against special characters like & | etc.