Re: Logon Script



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


.



Relevant Pages

  • Re: Logon script: Group membership not recognized?
    ... When you run GPResults against these users, does it show them as being a member of this group? ... Speed Group Policy Troubleshooting with the NEW GPHealth Reporter tool at http://www.sdmsoftware.com/products.php ... The script works just ... P drives like it should. ...
    (microsoft.public.windows.server.active_directory)
  • Re: Logon script: Group membership not recognized?
    ... whoami.exe has an option for showing all groups you're a member of. ... The script works just ... P drives like it should. ... Select Case strGroupName ...
    (microsoft.public.windows.server.active_directory)
  • Re: Standardize drive assignments
    ... script like I've said with this conditional "question" about which drive G: ... >> G drive) and the same 3 common drives. ... > team1 - contains all permanent members of team number one. ... > So, if a user is a direct member of team1, but only indirect in team2 ...
    (microsoft.public.windows.server.scripting)
  • Re: map two drives based on group membership
    ... I just realised I forgot something from this script. ... @ECHO OFF ... This means that if you have access to the share then you are a member of the right group so map the drive. ... map user to groupB's departmental drive using T: ...
    (microsoft.public.scripting.vbscript)
  • Re: Standardize drive assignments
    ... > Because, at that time, I had a Windows 4.0 environment, and this script ... >>> G drive) and the same 3 common drives. ... >> team1 - contains all permanent members of team number one. ... >> So, if a user is a direct member of team1, but only indirect in team2 ...
    (microsoft.public.windows.server.scripting)