Home All Groups Group Topic Archive Search About


Author
29 Jul 2005 1:39 AM
boe
Hello,

Years ago in Novell  I remember doing an ifmember logon script - eg.
ifmember of sales map shared drive to the sales share.

I never got one to work using a batch file (not vb script) for Windows 2003.
Is there an easy way of doing this so that whatever ifmember type command is
used, the workstation will be able to run it without having a local copy?

Author
29 Jul 2005 2:35 AM
Marty List
If the logon script batch file and ifmember.exe are in the same folder it
should be easy to do.  When you call it, just specify the script's directory
like this:

%0\..\IfMember.exe


Show quote
"boe" <boe_d@nospam.hotmail.com> wrote in message
news:OowaH59kFHA.4000@TK2MSFTNGP12.phx.gbl...
> Hello,
>
> Years ago in Novell  I remember doing an ifmember logon script - eg.
> ifmember of sales map shared drive to the sales share.
>
> I never got one to work using a batch file (not vb script) for Windows
> 2003. Is there an easy way of doing this so that whatever ifmember type
> command is used, the workstation will be able to run it without having a
> local copy?
>
Author
29 Jul 2005 3:12 AM
boe
Thanks for getting back to me so quickly - I've never seen the %0\ thing
before - if you have any more info I would really appreciate the assist.

Show quote
"Marty List" <use***@optimumx.com> wrote in message
news:O25$3Y%23kFHA.3936@TK2MSFTNGP10.phx.gbl...
>
> If the logon script batch file and ifmember.exe are in the same folder it
> should be easy to do.  When you call it, just specify the script's
> directory like this:
>
> %0\..\IfMember.exe
>
>
> "boe" <boe_d@nospam.hotmail.com> wrote in message
> news:OowaH59kFHA.4000@TK2MSFTNGP12.phx.gbl...
>> Hello,
>>
>> Years ago in Novell  I remember doing an ifmember logon script - eg.
>> ifmember of sales map shared drive to the sales share.
>>
>> I never got one to work using a batch file (not vb script) for Windows
>> 2003. Is there an easy way of doing this so that whatever ifmember type
>> command is used, the workstation will be able to run it without having a
>> local copy?
>>
>
>
Author
29 Jul 2005 3:39 AM
Marty List
I don't know if it's officially documented by Microsoft, but it's used in
some of their knowledge base articles and it's been around forever.  It
looks strange at first but it makes sense when you think about it.

If you pass parameters to a batch file, you access them with %1, %2, etc.
And the batch file itself is %0 (although it's not included with the other
parameters when you use "%*").  Every directory has . and .. entries, these
are handy references to itself and the parent directory.  Explorer and most
GUI apps hide them but DIR shows them.

So if you specify "%0\.." you're referencing the parent directory of the
batch file.

Run this script, the output might help explain it (just don't save the batch
file to the root of the drive):

@Echo On
Echo %%0: [%0]
Dir %0
Dir %0\..
Dir %0\..\.
Dir %0\..\..



Show quote
"boe" <boe_d@nospam.hotmail.com> wrote in message
news:uv8Oxs%23kFHA.320@TK2MSFTNGP09.phx.gbl...
> Thanks for getting back to me so quickly - I've never seen the %0\ thing
> before - if you have any more info I would really appreciate the assist.
>
> "Marty List" <use***@optimumx.com> wrote in message
> news:O25$3Y%23kFHA.3936@TK2MSFTNGP10.phx.gbl...
>>
>> If the logon script batch file and ifmember.exe are in the same folder it
>> should be easy to do.  When you call it, just specify the script's
>> directory like this:
>>
>> %0\..\IfMember.exe
>>
>>
>> "boe" <boe_d@nospam.hotmail.com> wrote in message
>> news:OowaH59kFHA.4000@TK2MSFTNGP12.phx.gbl...
>>> Hello,
>>>
>>> Years ago in Novell  I remember doing an ifmember logon script - eg.
>>> ifmember of sales map shared drive to the sales share.
>>>
>>> I never got one to work using a batch file (not vb script) for Windows
>>> 2003. Is there an easy way of doing this so that whatever ifmember type
>>> command is used, the workstation will be able to run it without having a
>>> local copy?
>>>
>>
>>
>
>
Author
29 Jul 2005 4:03 AM
boe
OK - I think I see what the "%0 is for - I'll have to test next week if I
can run a batch command from a workstation that references the server
(e.g. -\\myserver) ifmember command.  I'm sure it can be done, I just have
to do some testing.

Show quote
"Marty List" <use***@optimumx.com> wrote in message
news:%230k1W8%23kFHA.3148@TK2MSFTNGP09.phx.gbl...
>
> I don't know if it's officially documented by Microsoft, but it's used in
> some of their knowledge base articles and it's been around forever.  It
> looks strange at first but it makes sense when you think about it.
>
> If you pass parameters to a batch file, you access them with %1, %2, etc.
> And the batch file itself is %0 (although it's not included with the other
> parameters when you use "%*").  Every directory has . and .. entries,
> these are handy references to itself and the parent directory.  Explorer
> and most GUI apps hide them but DIR shows them.
>
> So if you specify "%0\.." you're referencing the parent directory of the
> batch file.
>
> Run this script, the output might help explain it (just don't save the
> batch file to the root of the drive):
>
> @Echo On
> Echo %%0: [%0]
> Dir %0
> Dir %0\..
> Dir %0\..\.
> Dir %0\..\..
>
>
>
> "boe" <boe_d@nospam.hotmail.com> wrote in message
> news:uv8Oxs%23kFHA.320@TK2MSFTNGP09.phx.gbl...
>> Thanks for getting back to me so quickly - I've never seen the %0\ thing
>> before - if you have any more info I would really appreciate the assist.
>>
>> "Marty List" <use***@optimumx.com> wrote in message
>> news:O25$3Y%23kFHA.3936@TK2MSFTNGP10.phx.gbl...
>>>
>>> If the logon script batch file and ifmember.exe are in the same folder
>>> it should be easy to do.  When you call it, just specify the script's
>>> directory like this:
>>>
>>> %0\..\IfMember.exe
>>>
>>>
>>> "boe" <boe_d@nospam.hotmail.com> wrote in message
>>> news:OowaH59kFHA.4000@TK2MSFTNGP12.phx.gbl...
>>>> Hello,
>>>>
>>>> Years ago in Novell  I remember doing an ifmember logon script - eg.
>>>> ifmember of sales map shared drive to the sales share.
>>>>
>>>> I never got one to work using a batch file (not vb script) for Windows
>>>> 2003. Is there an easy way of doing this so that whatever ifmember type
>>>> command is used, the workstation will be able to run it without having
>>>> a local copy?
>>>>
>>>
>>>
>>
>>
>
>
Author
29 Jul 2005 4:55 PM
James Whitlow
"boe" <boe_d@nospam.hotmail.com> wrote in message
news:OowaH59kFHA.4000@TK2MSFTNGP12.phx.gbl...
> Hello,
>
> Years ago in Novell  I remember doing an ifmember logon script - eg.
> ifmember of sales map shared drive to the sales share.
>
> I never got one to work using a batch file (not vb script) for Windows
2003.
> Is there an easy way of doing this so that whatever ifmember type command
is
> used, the workstation will be able to run it without having a local copy?

  You can forego using 'ifmember.exe' if you wish. Something like this
should work:

net.exe group "groupname" /domain|find /I "%username%">NUL:&&Echo Yes to
membership

  Since 'net.exe' comes standard with NT/2K/XP, you would not need to add
'ifmember.exe' to your sets or NETLOGON directory.
Author
29 Jul 2005 9:47 PM
Marty List
This will work, unless nested groups are being used.  The 'Net.exe Group'
command only enumerates the group's direct members by name, but IfMember.exe
enumerates all the SIDs in your access token.


Show quote
"James Whitlow" <jwhit***@letter.com> wrote in message
news:ekXpT5FlFHA.3960@TK2MSFTNGP12.phx.gbl...
> "boe" <boe_d@nospam.hotmail.com> wrote in message
> news:OowaH59kFHA.4000@TK2MSFTNGP12.phx.gbl...
> > Hello,
> >
> > Years ago in Novell  I remember doing an ifmember logon script - eg.
> > ifmember of sales map shared drive to the sales share.
> >
> > I never got one to work using a batch file (not vb script) for Windows
> 2003.
> > Is there an easy way of doing this so that whatever ifmember type command
> is
> > used, the workstation will be able to run it without having a local copy?
>
>   You can forego using 'ifmember.exe' if you wish. Something like this
> should work:
>
> net.exe group "groupname" /domain|find /I "%username%">NUL:&&Echo Yes to
> membership
>
>   Since 'net.exe' comes standard with NT/2K/XP, you would not need to add
> 'ifmember.exe' to your sets or NETLOGON directory.
>
>

AddThis Social Bookmark Button