Jump to content

Help with startup batch file for standalone laptops


Recommended Posts

Posted

I want to do something simple, but I need some help!

 

I want to create a file that will run at startup, and possibly logout or shutdown, to map some network shares to network drives on standalone laptops.

 

I know what net use commands to use (if that would be the best way to do it) and I know I can type these into a file using notepad.

 

But how do I name/create a file so that it runs as a login/logout script on the laptops? What do I call it, eg. file extension, and where do I put it?

 

I used to do things like this in DOS back in ye olde days, but not sure how these things work in standalone Windows!

Posted

Create your scripts in notepad, change the extention to .bat

 

In stand alone XP pro you have gpedit.msc (group policy editor), you can specify startup/shutdown scripts in there.

 

Or if its not needed to run on shutdown you could always place the script in the "all users" startup folder

  • Thanks 1
Posted
Create your scripts in notepad, change the extention to .bat

 

In stand alone XP pro you have gpedit.msc (group policy editor), you can specify startup/shutdown scripts in there.

 

Thanks. But can I just check - does gpedit.msc allow you to specify a location for the batch files, or should it be stored in a specific location?

Posted

Hi,

 

If you create your script something like this:

 

"@ECHO OFF

 

REM ----MAPPING DRIVES----

NET USE G: \\SERVER1\SHARE1

NET USE H: \\SERVER2\SHARE2

NET USE I: \\SERVER3\SHARE3

REM ------------------------

 

REM ----DELETING DRIVES----

NET USE G: /DELETE

NET USE H: /DELETE

NET USE I: /DELETE

REM -------------------------

 

EXIT"

 

Substitue the value of the Server and Share names for the ones you want to use. Then save the file as C:\logon.bat

 

Once this is complete open GPEDIT.MSC and navigate to either Computer Configuration if you require the sciript to run when the workstation start up, or User Configuration if you require the script to run when the user logs on.

 

In either of these section you can specify Start Up or Logon Scripts under the Windows Settings title.

 

Dan

  • Thanks 1
Posted
OK. Thanks for the help so far, but I have hit another snag. The standalone laptops don't have logons that map to the user's network logon. So I think I need to add the logon username and a prompt for password to the net use command line. However, that bit will be different for each user. So I can't make it part of the standard login script?? I can't put it in the All Users startup file either?? So do I have to put a different version of the batch file in each user's startup file?? One of the drives I want to map is to their home folder on the network server.
Posted
OK. Thanks for the help so far, but I have hit another snag. The standalone laptops don't have logons that map to the user's network logon. So I think I need to add the logon username and a prompt for password to the net use command line. However, that bit will be different for each user. So I can't make it part of the standard login script?? I can't put it in the All Users startup file either?? So do I have to put a different version of the batch file in each user's startup file?? One of the drives I want to map is to their home folder on the network server.

 

To answer your question, yes you'll need a different batch file for each user (because of the home directories), otherwise you could use the All Users > Startup method.

 

I have to ask though - why go to all this trouble? Why not join the machines to the domain so wherever someone logs on, all their drives are mapped correctly.

  • Thanks 1
Posted
To answer your question, yes you'll need a different batch file for each user (because of the home directories), otherwise you could use the All Users > Startup method.

 

I have to ask though - why go to all this trouble? Why not join the machines to the domain so wherever someone logs on, all their drives are mapped correctly.

 

I know...making a rod for my own back...

 

The only reason is that I have been led to believe that there are issues around joining teacher's laptops to the domain, because teachers also use their laptops for planning, etc at home when they are away from the network. Teachers also like to litter their laptop desktops with shortcuts, which wouldn't be possible with our mandatory profiles.

 

I'm without proper technical backup for sorting out this sort of thing, other than the wonderful Edugeek. The teachers are quite happy with their laptops being standalone, but would very much appreciate access to some stuff on the network. So that's why I'm thinking about batch files.

 

I dare say someone out there is rolling around laughing at the incredibly stupid and untechie way I go about things. But mostly so far things work OK.

Posted
I'm without proper technical backup for sorting out this sort of thing, other than the wonderful Edugeek. The teachers are quite happy with their laptops being standalone, but would very much appreciate access to some stuff on the network. So that's why I'm thinking about batch files.

 

Edugeek is a great place to learn and even though I have years of experience, I'm always learning new things and always happy to help :)

 

For authentication and maintenance purposes, I would recommend you join the laptops to the domain. Teachers can then logon to the network as normal, but also logon locally when they're at home. If you go take a look at existing networked machines, (press ctrl+alt+del). There should be a "Log on to" field drop down menu. This'll display both the domain name and the local machine name.

 

When in school, teachers could drop down to the domain name and logon as normal and access all their shared areas. Then when they go home, they logon using a local account on the local machine. I hope this gives you some insight as to what is possible.

  • Thanks 1
Posted

Thanks for the extra info about networking laptops. I had thought about doing it that way, but wasn't sure it would work. Not 100% sure all of our staff can cope with that, but I guess I could give it a go.

 

If they want to copy stuff from their local My Docs to their network My Docs, then...?? I mean, is there a straightforward way to do it (maybe the Learning Platform will make all this redundant)?

Posted
If they want to copy stuff from their local My Docs to their network My Docs, then...?? I mean, is there a straightforward way to do it (maybe the Learning Platform will make all this redundant)?

 

Flash memory sticks :) You can buy 1GB sticks for a couple of pounds these days.

Posted
Thanks for the extra info about networking laptops. I had thought about doing it that way, but wasn't sure it would work. Not 100% sure all of our staff can cope with that, but I guess I could give it a go.

 

If they want to copy stuff from their local My Docs to their network My Docs, then...?? I mean, is there a straightforward way to do it (maybe the Learning Platform will make all this redundant)?

 

We do the same and the staff just have to cope or they don't get their laptops connected!

 

With the my docs, we make them a power user on the laptop and put a shortcut in their network my documents that links to their laptop my documents.

 

Something else that I am investigating is making an intranet ftp server so that staff can access their network docs through their web browser. Just need to work out how they can access printers without logging in. That way there is no need to connect them to the domain.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...