Batch script to connect users to own mapped drives?

Soldato
Joined
7 Mar 2005
Posts
19,606
Location
LU7
I work in a school where the Sixth Form students use some old RM laptops. I believe they run XP Home which means they can't join a domain. This means we can't have a student log in to their own account as if they were on a computer in the IT room. They use a generic account with a common password.

Now I know it is possible to have a batch script run either at log on, or by being executed by a user, to map a network drive, but is it possible to have a batch script ask the user for their user name and password, i.e, their network user name and password, and from that map the correct drives for them?

They would still log on using the generic account and common password but is it possible to have a batch script that runs at logon that asks for the users' login details and then maps the according drives for them? I'm thinking this would be the best solution so that each time a Sixth Form student logs into the machine they can then 'log in' to their network drives and save/access files across the network.

I'll obviously do some research tomorrow as I've just thought of this potential solution to the problem and its a bit late to do that kind of thinking right now! :p I've got to make my lunch for tomorrow and get to bed. ;) If someone can confirm whether or not this is possible I have a feeling I can, potentially, put a script together myself. :cool:

Just to clarify something I've just realised might not be very clear, I want the script to ask the student for their user name and then their password and then with those details, if correct, run the 'net use' command to map the correct drives. So I need to get a script to take some input from the students in the form of user names and passwords and then pass each to the server to allow me to map the correct drives.
 
Last edited:
Hello Linkex. Yes, I think the shares will require a login. I will test this out on one of the Sixth Form laptops to see what details I need to give in order to access a share.

I'll give your code a go. It looks pretty good to me. Cheers. :)
 
I had a look at one of the laptops today. On the account that the students use I could see the shares on the server that I want to connect to but I couldn't actually access them, even using my admin user name and password. When I tried it on the Administrator account we have on each laptop, to allow us to work on the laptop, I was asked for a user name and password BEFORE I could even see the shares on the server. It looks as if an administrator account works but a limited account won't let me access the shares. I'm not sure why that is as the account type on the laptop shouldn't affect anything on the server in terms of me authenticating I wouldn't have thought?

I'll have to investigate a bit more and see if there are any other differences between the two accounts and see if another one is responsible for the difference in accessing shares. :)
 
Back
Top Bottom