[Samba] logon.bat
John H Terpstra
jht at Samba.Org
Tue Jul 5 17:52:39 GMT 2005
On Tuesday 05 July 2005 11:15, Jason Greene wrote:
> Hi all,
>
> My logon.bat file runs but none of the drives get mapped.
>
> Here is my logon.bat file
%L is a macro that can be used in your smb.conf file, beyond Samba it is not
known.
You will need to change that to:
>
> net time \\%L /set /yes
> net use o: \\%L\data
> net use j: \\%L\pca
> net use g: \\%L\peachtree
net time %LOGONSERVER% /set /yes
net use o: %LOGONSERVER%\data
net use j: %LOGONSERVER%\pca
net use g: %LOGONSERVER%\peachtree
You can find the Windows environment macros that can be used by opening up a
cmd shell on a Windows client, then execute: set
An example from my XP Pro client is:
ALLUSERSPROFILE=C:\Documents and Settings\All Users
APPDATA=C:\Documents and Settings\jht\Application Data
CLIENTNAME=Console
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=MAGGOT
ComSpec=C:\WINDOWS\system32\cmd.exe
FP_NO_HOST_CHECK=NO
HOMEDRIVE=H:
HOMEPATH=\
HOMESHARE=\\merlin\jht
LOGONSERVER=\\MERLIN
NUMBER_OF_PROCESSORS=1
OS=Windows_NT
Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program
Files\SSH Communications Security\SSH Secure Shell
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 8 Stepping 6, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0806
ProgramFiles=C:\Program Files
PROMPT=$P$G
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\DOCUME~1\jht\LOCALS~1\Temp
TMP=C:\DOCUME~1\jht\LOCALS~1\Temp
USERDOMAIN=MIDEARTH
USERNAME=jht
USERPROFILE=C:\Documents and Settings\jht
windir=C:\WINDOWS
You can use these macros in your logon script by appropriately dereferencing
them, for example:
echo %LOGONSERVER%
prints:
\\MERLIN
- John T.
>
>
> Is this setup wrong?
>
> --
> Regards.
>
> In Christ,
>
> Jason Greene
>
> Angelus Press
> IT Manager
> 2915 Forest Avenue
> Kansas City, MO 64109-1516
> 1.800.966.7337 x306
> 1.816.753.3557 (fax)
> www.angeluspress.org
--
John H Terpstra
Samba-Team Member
Phone: +1 (650) 580-8668
Author:
The Official Samba-3 HOWTO & Reference Guide, ISBN: 0131453556
Samba-3 by Example, ISBN: 0131472216
Hardening Linux, ISBN: 0072254971
Other books in production.
More information about the samba
mailing list