Question : net use skip if credentials don't match

Dear All,

I do have a netlogon script which connects some network drives, e.g.
net use o: \\bananas01\commercial
net use o: \\bananas01\technical

The Shares are permitted only for some special groups, If this user is not member of the commercial group the netlogon script will stop and ask for user credentials:

Enter the user name for 'bananas01':

How can i modify the net use comment to force it, for skipping if there is a credential issue.
Thanks

Answer : net use skip if credentials don't match


You can't use that for Batch Files. "On Error Resume Next" is a VbScript statement. :)

If you're sticking with Batch, you should maybe consider using "ifmember.exe" which will allow you to check whether or not the user belongs to a group before mapping the drive.

IfMember is here:

http://www.microsoft.com/downloadS/details.aspx?FamilyID=07c2f6d7-815e-4fa0-9043-4e4635ccd417&displaylang=en

Usage example below.

Chris
1:
2:
3:
4:
5:
6:
IfMember.exe "SomeGroup"
if not errorlevel 1 goto NotMember
net use F: \\server\share
 
:NotMember
etc
Open in New Window Select All
Random Solutions  
 
programming4us programming4us