+ Post New Thread
Results 1 to 13 of 13
Windows Thread, Help with startup batch file for standalone laptops in Technical; I want to do something simple, but I need some help! I want to create a file that will run ...
  1. #1
    Andie's Avatar
    Join Date
    Sep 2006
    Location
    Cambridgeshire
    Posts
    795
    Thank Post
    167
    Thanked 66 Times in 49 Posts
    Rep Power
    30

    Help with startup batch file for standalone laptops

    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!

  2. #2
    pooley's Avatar
    Join Date
    Sep 2005
    Location
    S Wales
    Posts
    1,146
    Thank Post
    80
    Thanked 122 Times in 103 Posts
    Rep Power
    68
    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

  3. Thanks to pooley from:

    Andie (6th October 2008)

  4. #3
    Andie's Avatar
    Join Date
    Sep 2006
    Location
    Cambridgeshire
    Posts
    795
    Thank Post
    167
    Thanked 66 Times in 49 Posts
    Rep Power
    30
    Quote Originally Posted by pooley View Post
    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?

  5. #4

    Join Date
    Mar 2007
    Posts
    1,792
    Thank Post
    82
    Thanked 296 Times in 227 Posts
    Rep Power
    87
    i believe you specify.

  6. Thanks to strawberry from:

    Andie (6th October 2008)

  7. #5
    danrhodes's Avatar
    Join Date
    Sep 2008
    Location
    Wath Upon Dearne
    Posts
    1,513
    Thank Post
    157
    Thanked 181 Times in 150 Posts
    Rep Power
    68

    Cool

    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

  8. Thanks to danrhodes from:

    Andie (7th October 2008)

  9. #6
    Andie's Avatar
    Join Date
    Sep 2006
    Location
    Cambridgeshire
    Posts
    795
    Thank Post
    167
    Thanked 66 Times in 49 Posts
    Rep Power
    30
    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.

  10. #7

    Michael's Avatar
    Join Date
    Dec 2005
    Location
    Birmingham
    Posts
    9,262
    Thank Post
    242
    Thanked 1,572 Times in 1,252 Posts
    Rep Power
    340
    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.

  11. Thanks to Michael from:

    Andie (8th October 2008)

  12. #8
    Andie's Avatar
    Join Date
    Sep 2006
    Location
    Cambridgeshire
    Posts
    795
    Thank Post
    167
    Thanked 66 Times in 49 Posts
    Rep Power
    30
    Quote Originally Posted by Michael View Post
    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.

  13. #9

    Michael's Avatar
    Join Date
    Dec 2005
    Location
    Birmingham
    Posts
    9,262
    Thank Post
    242
    Thanked 1,572 Times in 1,252 Posts
    Rep Power
    340
    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.

  14. Thanks to Michael from:

    Andie (11th October 2008)

  15. #10
    danrhodes's Avatar
    Join Date
    Sep 2008
    Location
    Wath Upon Dearne
    Posts
    1,513
    Thank Post
    157
    Thanked 181 Times in 150 Posts
    Rep Power
    68
    This is what we do and it works well and has done for a long time now

  16. #11
    Andie's Avatar
    Join Date
    Sep 2006
    Location
    Cambridgeshire
    Posts
    795
    Thank Post
    167
    Thanked 66 Times in 49 Posts
    Rep Power
    30
    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)?

  17. #12

    Michael's Avatar
    Join Date
    Dec 2005
    Location
    Birmingham
    Posts
    9,262
    Thank Post
    242
    Thanked 1,572 Times in 1,252 Posts
    Rep Power
    340
    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.

  18. #13
    actech's Avatar
    Join Date
    Mar 2008
    Location
    Australia
    Posts
    198
    Thank Post
    50
    Thanked 20 Times in 17 Posts
    Rep Power
    17
    Quote Originally Posted by Andie View Post
    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.

SHARE:
+ Post New Thread

Similar Threads

  1. Default Printer Batch File
    By karldenton in forum Windows
    Replies: 13
    Last Post: 23rd March 2010, 05:16 PM
  2. batch file comman
    By jussy65 in forum Scripts
    Replies: 3
    Last Post: 13th August 2008, 07:10 AM
  3. Startup/Shutdown batch not working
    By tmcd35 in forum How do you do....it?
    Replies: 6
    Last Post: 30th March 2008, 05:27 PM
  4. Pass £ in batch file
    By meastaugh1 in forum Windows
    Replies: 2
    Last Post: 17th January 2008, 08:02 PM
  5. batch file help
    By beeswax in forum Scripts
    Replies: 9
    Last Post: 3rd March 2006, 07:48 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •