Question : NT Login Script Error

I'm trying to get "ifmember" to work properly in an NT login script.  It worked fine until I added another ifmember statement and now I'm getting a syntax error and I don't know what it is.  I've tested different syntaxes, but now I'm not exactly sure of the correct way.  Below is what I got.  What happens is the drive to MAS500_Reports always maps, but the Plantops never does.  I've seen some sample login scripts use quotes for the groups, others not.  
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
:PLANTOPS
ifmember "PLANTOPS"
if errorlevel 1 goto PLANTOPS
if not errorlevel 1 goto NEXT
 
:PLANTOPS
net use p: /delete > Nul:
net use p: \\mystique\plantops
Echo Drive P is mapped to \\mystique\PLANTOPS
 
:NEXT
ifmember "MAS500_Reports"
if errorlevel 1 goto MAS500_Reports
if not errorlevel1 goto Warning
 
:MAS500_Reports
net use u: /delete > Nul:
net use u: \\gf-finance\mas500_reports
Echo Drive U is mapped to \\gf-finance\MAS500_Reports
 
goto Warning
 
:Warning
call \\cartman\netlogon\warning.bat
 
:EXIT

Answer : NT Login Script Error

"%~dp0" should expand to the current script's (%0) *D*rive and *P*ath.
Are you sure you copied the script exactly as posted?
- How are you running that script?
- What OS are you running this script on?
- Is ifmember.exe in the same folder as the script?
- What is the result when you run
ifmember.exe /list
Do you get a correct list of your group membership?
Random Solutions  
 
programming4us programming4us