[NTLUG:Discuss] Getting Linux and NT to play nice.
Merlin
merlin at tacni.net
Mon Apr 21 13:04:40 CDT 2003
Quoting Kelledin <kelledin+NTLUG at skarpsey.dyndns.org>:
> On Friday 18 April 2003 05:10 am, Stephen Klein wrote:
> > My question is, does anyone know of a way to get WinNT 4 to
> > connect to a SAMBA share automatically from a reboot without
> > someone logging in first.
>
> Hmmm...I'm a little rusty on this. Somewhere in the registry,
> deep under HKEY_LOCAL_MACHINE, is a subkey called "Run". I used
> to know exactly where that was in the registry hierarchy (would
> probably still know if I worked with windows more), but I do
> remember that there's a "RunOnce" subkey right next to it. Just
> do a registry search for "RunOnce" and it should get you there.
Actually, the RUN key is only executed on interactive login. There is,
however, a RunService or RunServices key that is executed on boot, and not
interactive login.
>
> Stick an arbitrarily-named value in that subkey, with the data
> being the path to some command, and IIRC that command will get
> run on every boot, whether someone logs in or not.
>
> Once you've done that, the next thing is to create a batch file
> that runs the necessary "net" commands to map the share to a
> drive letter, then runs your backup operation and unmaps the
> share before exiting. Then just stick the path to that batch
> file in the "Run" subkey...
>
> Too bad I never learned much about the Windows "net" command line
> tool. :(
As long as the share does not require user validation, you can issue the NET
command. The syntax would be:
NET USE J: \\server\share
Obviously, substitute whatever drive letter you want for J:
--
Merlin
"Do not meddle in the affairs of Wizards,
for they are subtle and quick to anger."
More information about the Discuss
mailing list