Where do I put a .bat script to get the server to mount network drives at startup?

I have a Windows 2003 SBS server which is working fine, I have also created some .bat
scripts that ensure that when clients log in they get appropriate network drives. Now my
question, is how do I get the server itself to map these network drives AUTOMATICALLY
each time it boots?

I don't need to know the commands for net use merely what I should name the file and
where I should put it!!!

Thanks and take care

Mark
markbenhamAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lamaslanyCommented:
Do yo mean when it boots or when someone logs on to it?
0
LotokCommented:
either in c:\documents and settings\all users\start menu\programs\startup
OR
you can create a reg string pointing to the bat file in windows registry
start-->run
type regedit
navigate to
local machine--> software-->microsoft--> windows --> current version --> run
right click on right hand pane and choose new string
name it whatever you like and make the value the path to the bat file.

voila
0
LotokCommented:
i assume in my last post they all use the same bat file.
if different users need different scripts, then it depends on your setup.

if you're on AD each user account in properties has a login script input box where you can type path to the bat file.
0
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

Rob WilliamsCommented:
May I ask why you need the SERVER to map drive at boot, i.e. when no one is logged on. Mapped drives are used by users, not services running on the PC.....as a rule. Perhaps you have a unique requirement, or there is another solution. If users require them on the server for some reason, they would automatically be mapped when they log on, as they would on a PC with their standard logon script..
0
markbenhamAuthor Commented:
Good question!! The answer is that we are backing up the data on the external shares (a NAS
and a Mac) via the SBS server and Back-up Exec!
0
Rob WilliamsCommented:
Usually you would do that not with a mapped drive, as it will not be present until logon, but rather a UNC name, such as:
\\DeviceName\ShareName
or
\\192.168.123.123\ShareName
0
Rob WilliamsCommented:
markbenham, may I ask why you accepted the answer that you did? A back up runs as a service without a user log on, or intervention. The drive will not be mapped upon server reboot, only when a user logs on.
The server will not; "map these network drives AUTOMATICALLY each time it boots?"

If you really need a batch file to run without user logon, you can add it to a group policy applied to the server, under start up scripts, rather that as a logon script:
Computer configuration | Windows settings | Scripts | Startup
However, this is not a solution for mapping dives.
--Rob
0
markbenhamAuthor Commented:
Thanks Rob, I appreciate your feedback and you are of course quite right.
What I really wanted though was an answer to the question as this was the
way the user's installation had worked previously, and for some reason it
had broke. All I wanted to do was to 'put it back' the way it was!!

Your answer was good though


Take care

Mark
0
Rob WilliamsCommented:
Thanks for the clarification Mark. It's important, as others who follow will read, and want to know the correct answer to the question you asked. The "accepted solution" is very misleading.

A) it does not correctly answer your question, as you have agreed
B) the start up folder is not an "accepted" method of applying scripts in a domain environment. You would use the user's profile, or group policy to apply to users or computers. I am doubtful using the startup folder is "the way it was". That folder would more often be used in a workgroup environment.
c) most importantly, is your backup working properly, or can we help you with that. Backup Exec runs as a service and does not require a logon, and therefore should not be dependent on drive mappings
0
Lee W, MVPTechnology and Business Process AdvisorCommented:
I agree - using group policy for scripts is more appropriate OR using a scheduled task to run the batch file and ensuring the that batch file includes the net use commands appropriate to ensure the drive(s) are available.  That's how I execute my backup scripts.

It sounds like you just wanted to make sure an inefficient system of backup still worked instead of repairing the inefficient one with a more reliable robust one... And mislead those trying to help you by not providing all the details from the start.  You got, apparently the answer you wanted... but you'll get answers faster - and better - if your honest and explain up front what your real goals are.
0
Rob WilliamsCommented:
Thanks leew. Appreciate the support :-)
--Rob
0
Rob WilliamsCommented:
Hi, Vee_Mod. Tough call. I was not suggesting a correct or acceptable answer has been provided as much as the accepted answer will not "map these network drives AUTOMATICALLY each time it boots", as asked.

I suspect the real problem, or detailed proper back up procedure, still has not been addressed. If a choice had to be made I would recommend a point split between ID:20858461, and ID: 20859303 as viable options.
Thanks for taking the time.
--Rob
0
markbenhamAuthor Commented:
Hi Guys, Thanks for all this traffic but I was happy with the answer I received and more importantly it did what I wanted and everything worked fine!! Appreciate your obvious and considerable expertise and I am sure your solution is more elegant. Didn't really ask a question about how to re-configure the clients back-up system nor did I wish to know!! We already implement back-up Exec abd UNC's in other sites, this was a 'not paid for' favour for someone who was working in this way and had lost their mapped drives . . . Please close this case and award points to whoever you wish - frankly, the original answer was clear and concise, and more importantly it worked. If you have a problem with the methodology and there are better ways to do things, then that probably applies to 100's of problems on here. Its your call, just close this will you as its dragging on for no good reason.
0
Rob WilliamsCommented:
markbenham,
The only concern is many people read these posts for years to come. As a matter of fact, far more people find answers by reading existing questions than those asked. When they do so they "jump" to the correct answer. That solution was not the correct answer to; "how do I get the server itself to map these network drives AUTOMATICALLY each time it boots", because it won't accomplish that. A script in a start up folder will not run until a user logos on.

I also stated I did not necessarily feel a final correct or acceptable answer had necessarily be found.

Perhaps delete and refund points would be a better solution.
0
markbenhamAuthor Commented:
Hi Rob,

I have looked through all your answers (rather than advice) and I cannot find any
instructions on how to do this using Group Policy mate!!! If you want to write
instructions that are easy to follow (step by step) on doing this by a Group
Policy then I'll happily try your solution, but I do need really clear step by step
instructions mate . . .

If it works then I'll look at trying to sort out the points etc. etc.

Thanks and take care

Mark
0
Rob WilliamsCommented:
As mentioned, mapping a drive as a service is not ideal. Mappings as a rule are used by users. So I still do not consider this an ideal solution, but it will run your script when the server reboots. If you wish to set it up, using group policy reqires create and link a policy to an OU (organizational unit). To make your life easier, make sure the "Group Policy Management Console" is installed in Administrative Tools. If not you can download for free from:
http://www.microsoft.com/downloads/details.aspx?FamilyID=0A6D4C24-8CBD-4B35-9272-DD3CBFC81887&displaylang=en

-Open GPMC (Group Policy Management Console)
-On the OU that contains the server or PC yu want to affect, right click on it and choose create and link a GPO here
-assin it a name like: "Apply start up script" and choose OK
-click on the OU to expand it and you will see your policy listed
-right click on the policy and choose edit, which will open the group policy editor
-browse to: Computer configuration | Windows settings | Scripts
-in the righthand window right click on startup and choose properties
-click add
-click browse and browse to the location of the script you want to use.
Note: The correct permissions must be set to allow the script to run, therefore the best location for it is a default script folder, such as:
\\Servername \NETLOGON
Which is actually (on the server):
C:\Windows\SYSVOL\sysvol\<domainname>\Scripts
-Done
-the policy will not be applied for 5 minutes. You can force it by running at a command line  gpupdate /force
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
markbenhamAuthor Commented:
Yes the answers fine thanks very much lets close it and award points as you see fit.
0
markbenhamAuthor Commented:
A really good and quick answer - thanks so much. Worked a treat . . .

Take care

Mark
0
Rob WilliamsCommented:
Thanks Mark. Glad it worked for you. Sorry to give you a hard time.
Cheers !
--Rob
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Networking

From novice to tech pro — start learning today.