Mapping drives with batch file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all

I have 35 Win2k SP4 clients, 1x Win2k server and 2x Win2003 servers. I've
edited GPs before via ADUC (properties of OU), but never wrote one from
scratch, which is what I am having to do now.

I created a 'test' ou with no inheritence, a test user in said OU, and wrote
a batch file containg the simple line 'net use p: \\yaddayadda'. Mapped
drives are a must here, as its so disorganized with no standard. But when I
log in, nothing. I've stumbled at the first step. What am I missing? Ive
read absolute masses about GPs, but its all too much, I just need to know how
to do the basics like getting some common drives mapped.

Any help would be really appreciated
 
Just a quick question -- the net use command would be "net use p:
\\servername\sharename" -- are you just using the server name?
Brian
 
Hi Brian

no I'm pointing toward the share I want mapped to. I always test in a cli
before trying on the login script so that I know that my syntax is correct or
not.
 
Chris,
If I go to a dos prompt and type net use /?, I get the following syntax:
NET USE [devicename | *] [\\computername\sharename[\volume] [password | *]]
Did you try it with the servername (or IP address) and a share name?

If you go to a dos prompt and try your command, does it work? If it does
work, then we will have to look at the GP or OU.
Brian
 
I've tried it at a command prompt and using servername or ip address with
relevant share it maps fine. The gp for that ou has nothing else specified,
it is completely fresh. Inheritence is blocked, so I can't see how the
default domain policy would affect anything, and there are no policies
inbetween.


Brian K. Sheperd said:
Chris,
If I go to a dos prompt and type net use /?, I get the following syntax:
NET USE [devicename | *] [\\computername\sharename[\volume] [password | *]]
Did you try it with the servername (or IP address) and a share name?

If you go to a dos prompt and try your command, does it work? If it does
work, then we will have to look at the GP or OU.
Brian



Chris Hagon said:
Hi Brian

no I'm pointing toward the share I want mapped to. I always test in a cli
before trying on the login script so that I know that my syntax is correct or
not.
 
If it works manually, then you probably need to check the GP end of things.
Try running gpresults on the test workstation to see if it getting any group
policies. Also check your workstation's dns and make sure that the server
is the primary DNS entry.
Brian


Chris Hagon said:
I've tried it at a command prompt and using servername or ip address with
relevant share it maps fine. The gp for that ou has nothing else specified,
it is completely fresh. Inheritence is blocked, so I can't see how the
default domain policy would affect anything, and there are no policies
inbetween.


Brian K. Sheperd said:
Chris,
If I go to a dos prompt and type net use /?, I get the following syntax:
NET USE [devicename | *] [\\computername\sharename[\volume] [password | *]]
Did you try it with the servername (or IP address) and a share name?

If you go to a dos prompt and try your command, does it work? If it does
work, then we will have to look at the GP or OU.
Brian



Chris Hagon said:
Hi Brian

no I'm pointing toward the share I want mapped to. I always test in a cli
before trying on the login script so that I know that my syntax is
correct
or
not.

:

Just a quick question -- the net use command would be "net use p:
\\servername\sharename" -- are you just using the server name?
Brian


Hi all

I have 35 Win2k SP4 clients, 1x Win2k server and 2x Win2003
servers.
I've
edited GPs before via ADUC (properties of OU), but never wrote one from
scratch, which is what I am having to do now.

I created a 'test' ou with no inheritence, a test user in said OU, and
wrote
a batch file containg the simple line 'net use p: \\yaddayadda'. Mapped
drives are a must here, as its so disorganized with no standard.
But
when
I
log in, nothing. I've stumbled at the first step. What am I missing?
Ive
read absolute masses about GPs, but its all too much, I just need
to
know
 
hi Brian

I seem to have this working now. I think it's maybe because I browsed to my
batch file as opposed to put it in the script folder in the correct place.

It seems a batch file will do what I want.. but is there any benefit using a
vb script over a batch file other than the obvious (ie there is a lot more I
can set/get it to do) ?

Thanks for your help Brian



Brian K. Sheperd said:
If it works manually, then you probably need to check the GP end of things.
Try running gpresults on the test workstation to see if it getting any group
policies. Also check your workstation's dns and make sure that the server
is the primary DNS entry.
Brian


Chris Hagon said:
I've tried it at a command prompt and using servername or ip address with
relevant share it maps fine. The gp for that ou has nothing else specified,
it is completely fresh. Inheritence is blocked, so I can't see how the
default domain policy would affect anything, and there are no policies
inbetween.


Brian K. Sheperd said:
Chris,
If I go to a dos prompt and type net use /?, I get the following syntax:
NET USE [devicename | *] [\\computername\sharename[\volume] [password | *]]
Did you try it with the servername (or IP address) and a share name?

If you go to a dos prompt and try your command, does it work? If it does
work, then we will have to look at the GP or OU.
Brian



Hi Brian

no I'm pointing toward the share I want mapped to. I always test in a cli
before trying on the login script so that I know that my syntax is correct
or
not.

:

Just a quick question -- the net use command would be "net use p:
\\servername\sharename" -- are you just using the server name?
Brian


Hi all

I have 35 Win2k SP4 clients, 1x Win2k server and 2x Win2003 servers.
I've
edited GPs before via ADUC (properties of OU), but never wrote one
from
scratch, which is what I am having to do now.

I created a 'test' ou with no inheritence, a test user in said OU, and
wrote
a batch file containg the simple line 'net use p: \\yaddayadda'.
Mapped
drives are a must here, as its so disorganized with no standard. But
when
I
log in, nothing. I've stumbled at the first step. What am I missing?
Ive
read absolute masses about GPs, but its all too much, I just need to
know
how
to do the basics like getting some common drives mapped.

Any help would be really appreciated
 
As you mentioned, I believe that VBS would just give you more functionality.
For mapping drives, a batch would be fine. There are programs that could be
used to enhance batch files. One that I can think of is called
"ifmember" -- to test if user is a member of a group, then you could branch
to an area in the batch file. I havent used it, but it may be of interest.

Glad to hear that you got it working.

Brian


Chris Hagon said:
hi Brian

I seem to have this working now. I think it's maybe because I browsed to my
batch file as opposed to put it in the script folder in the correct place.

It seems a batch file will do what I want.. but is there any benefit using a
vb script over a batch file other than the obvious (ie there is a lot more I
can set/get it to do) ?

Thanks for your help Brian



Brian K. Sheperd said:
If it works manually, then you probably need to check the GP end of things.
Try running gpresults on the test workstation to see if it getting any group
policies. Also check your workstation's dns and make sure that the server
is the primary DNS entry.
Brian


Chris Hagon said:
I've tried it at a command prompt and using servername or ip address with
relevant share it maps fine. The gp for that ou has nothing else specified,
it is completely fresh. Inheritence is blocked, so I can't see how the
default domain policy would affect anything, and there are no policies
inbetween.


:

Chris,
If I go to a dos prompt and type net use /?, I get the following syntax:
NET USE [devicename | *] [\\computername\sharename[\volume]
[password |
*]]
Did you try it with the servername (or IP address) and a share name?

If you go to a dos prompt and try your command, does it work? If it does
work, then we will have to look at the GP or OU.
Brian



Hi Brian

no I'm pointing toward the share I want mapped to. I always test
in a
cli
before trying on the login script so that I know that my syntax is correct
or
not.

:

Just a quick question -- the net use command would be "net use p:
\\servername\sharename" -- are you just using the server name?
Brian


Hi all

I have 35 Win2k SP4 clients, 1x Win2k server and 2x Win2003 servers.
I've
edited GPs before via ADUC (properties of OU), but never wrote one
from
scratch, which is what I am having to do now.

I created a 'test' ou with no inheritence, a test user in said
OU,
and
wrote
a batch file containg the simple line 'net use p: \\yaddayadda'.
Mapped
drives are a must here, as its so disorganized with no
standard.
But
when
I
log in, nothing. I've stumbled at the first step. What am I missing?
Ive
read absolute masses about GPs, but its all too much, I just
need
to
know
how
to do the basics like getting some common drives mapped.

Any help would be really appreciated
 
Back
Top