Re: Logon Script
- From: "Deji Akomolafe" <noemail@xxxxxxxxxxxxxxxx>
- Date: Thu, 5 May 2005 12:21:08 -0700
from my vantage point here, those 2 lines work. The "if exist" part is just
a check to see that Q is actually maped to something already. If it is, it
gets deleted and the script goes to the next line. If it's not, the script
does nothing and goes to the next line. You may have some logic problems in
the code.
Why don't you put in some checkpoints into your code, like this:
net use
pause ---this will let you see what drives are mapped to where and the
script waits for you to press a key to continue
if exist q: echo "Q driver exists!!!!"& net use Q: /delete /y
if exist q: echo "there is a problem. Q drive just won't go away!!!!"
pause
net use q: \\server\sales
pause
net use
or something along that line.
--
Sincerely,
Dèjì Akómöláfé, MCSE+M MCSA+M MCP+I
Microsoft MVP - Directory Services
www.readymaids.com - we know IT
www.akomolafe.com
Do you now realize that Today is the Tomorrow you were worried about
Yesterday? -anon
"Dan" <dankennedy24@xxxxxxxxxxx> wrote in message
news:1115312074.459114.72830@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hey Deji,
I tried this already and I get the same results, did you try this?
If Q: is mapped the drive does get deleted; however, when the next
piece of the script attempts to map Q: again the script hangs. Any
other ideas?
Thanks,
Dan
Deji Akomolafe wrote:
> if exist Q: echo "drive exists"& net use Q: /delete /y
> net use Q: \\server\sales
>
> --
>
> Sincerely,
> Dèjì Akómöláfé, MCSE+M MCSA+M MCP+I
> Microsoft MVP - Directory Services
> www.readymaids.com - we know IT
> www.akomolafe.com
> Do you now realize that Today is the Tomorrow you were worried about
> Yesterday? -anon
> "Dan" <anonymous@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:0f7601c55111$39f21ef0$a501280a@xxxxxxxxxx
> > Anyone know why I couldn't do something like this in my
> > (.bat) logon script? I'm seeing what appears to be the
> > net use /delete command not finishing before the next
> > command begins. I'm doing this in case a user is a
> > member of both of the groups so as to avoid a conflict of
> > the same drive letter attempting to be mapped twice and
> > producing an error.
> >
> > :sales
> > @echo off
> > ifmember "salesuser"
> > if not errorlevel 1 goto ops
> > echo Connecting to Sales Share...
> > net use /delete q:
> > net use q: \\server\sales
> >
> > :ops
> > @echo off
> > ifmember "opsuser"
> > if not errorlevel 1 goto HR
> > echo Connecting to Ops Share...
> > net use /delete q:
> > net use q: \\server\ops
> >
> > So in a nutshell, if a user is a member of both groups I
> > don't want any errors to pop up (specifically, taking out
> > the net use /delete q: command will hang the script and
> > error with System error 85 which means the drive letter
> > is already taken). This only occurs if the user is a
> > member of both groups. Can I get around this any other
> > way?
> >
> > Thanks,
> > Dan
.
- References:
- Logon Script
- From: Dan
- Re: Logon Script
- From: Deji Akomolafe
- Re: Logon Script
- From: Dan
- Logon Script
- Prev by Date: Re: Windows cannot determine the user or computer name
- Next by Date: Re: Adprep /domainprep errors
- Previous by thread: Re: Logon Script
- Next by thread: Re: Logon Script
- Index(es):
Relevant Pages
|