[Samba] windows /bat script question
Kaplan, Marc
marc_kaplan at adaptec.com
Wed Mar 9 17:10:47 GMT 2005
This is definitely a kludgy way of doing it, but if I had that problem
and wanted to solve it quickly, I would put a file named THISISSERVER1
on \\server1\projects\. This way you can do an "if exist
p:\THISISSERVER1" test. This is ugly, but it will work.
-Marc
> -----Original Message-----
> From: samba-bounces+marc_kaplan=adaptec.com at lists.samba.org
[mailto:samba-
> bounces+marc_kaplan=adaptec.com at lists.samba.org] On Behalf Of
Alexander
> Lazarevich
> Sent: Wednesday, March 09, 2005 8:51 AM
> To: samba at lists.samba.org
> Subject: [Samba] windows /bat script question
>
> Subject isn't exactly samba, but samba people usually know a lot about
> windows bat scripting. Here's my problem:
>
> Currently our domain login script is doing this (among other things):
>
> ifmember.exe "WINDOWS-DOMAIN\Projects"
> if errorlevel 1 ( net use p: \\server1\projects )
>
> This works fine. The problem is I'm moving the projects storage to a
> different server called server 2 (which is linux running samba 3, so
it
> is samba related somewhat). The logic I need is:
>
> If p: is on server 1, remove the persistant share \\server1\projects,
then
> if p: does not exist, create a persistant share p: \\server2\projects.
>
> Sounds easy enough, but I have no idea how to test if a share is on a
> particular remote server. I'm trying "if exist \\server1\projects",
but
> that doesn't work the way I want it as scripts seem to only understand
the
> local drive letter names, not the remote names. I could try to spit
out
> the contents of "net use p:" to a file, then parse out the remote name
> string, and compare that, but that seems like a hard way to accomplish
it
> and I don't want the script parsing out stuff during a login. There's
got
> to be an easier way.
>
> I could also just always remove the p:, then mount it from server2.
But
> that adds an extra /delete every single time someone logs on, I'd
prefer
> not to do that. I only want to /delete p: if p: is remote server1, not
if
> it's remote server 2.
>
> Anyone have an idea?
>
> Thanks in advance,
>
> Alex
> --
> To unsubscribe from this list go to the following URL and read the
> instructions: https://lists.samba.org/mailman/listinfo/samba
More information about the samba
mailing list