Running BAT file before/during boot?

  • Thread starter Thread starter Noozer
  • Start date Start date
N

Noozer

I want to mount some network drives as the OS starts, and before some
utilities load. is there an easy way to do this?

For example:

O:\ is mapped to "\\Server\Shared\MyDocs", and I have my "My Documents"
folder pointing here. The icon in My Computer shows a disconnected drive
until I actually open the folder.

How can I have this drive already mounted before the desktop loads and
services start?
 
Greetings --

Right-click My Computer (or My Network Places) > Map Network
Drive, select the desired drive letter, enter the computer and share
name where indicated, place a check mark in the "Reconnect at logon"
box.

Alternatively, or particularly if you want the same drive mapping
to apply to each individual user who uses the computer, create a batch
file containing something similar to the text below, and place a
shortcut to it in the C:\Documents and Settings\All Users\Start
Menu\Programs\Startup folder:

================================

Net use K: \\computername\sharename
Net use L: \\computername\sharename

================================

Bruce Chambers
 
Bruce Chambers said:
Greetings --

Right-click My Computer (or My Network Places) > Map Network
Drive, select the desired drive letter, enter the computer and share
name where indicated, place a check mark in the "Reconnect at logon"
box.

Doesn't work... All my mapped drives are already configured this way. They
refuse to connect until I actually open them. A couple utilities I have
won't see these drives at startup since they aren't connected yet.
Alternatively, or particularly if you want the same drive mapping
to apply to each individual user who uses the computer, create a batch
file containing something similar to the text below, and place a
shortcut to it in the C:\Documents and Settings\All Users\Start
Menu\Programs\Startup folder:

================================

Net use K: \\computername\sharename
Net use L: \\computername\sharename

================================

Again, in the Startup folder, the system is already running so it is too
late to mount the shares. Services, drivers, etc. have already loaded at
this point.
 
Noozer said:
Doesn't work... All my mapped drives are already configured this way. They
refuse to connect until I actually open them. A couple utilities I have
won't see these drives at startup since they aren't connected yet.


Again, in the Startup folder, the system is already running so it is too
late to mount the shares. Services, drivers, etc. have already loaded at
this point.

Connecting drive letters to shares in the background (i.e. under
an account other than your foreground account) is not a good
idea. You are likely to end up with invisible drive letters: The
connections may be there but they are invisible and you cannot
delete them.

If you have tools and services that depend on remote connections
at startup time then they should access these connections using
UNC coding.

If you insist on doing it your way then you can launch Bruce's
batch file via the Task Scheduler. This lets you launch the file
at startup time (rather than at logon time). You are then likely
to encounter problems relating to the order in which the various
services are launched - here is some light reading on the subject:

How to Control Device Driver Load Order
http://support.microsoft.com/default.aspx?scid=kb;[LN];115486

How to Delay Loading of Specific Services
http://support.microsoft.com/default.aspx?kbid=193888
 
Back
Top