Logon-Script

tschweikle at FIDUCIA.de tschweikle at FIDUCIA.de
Wed Mar 1 16:51:03 GMT 2000


fabian at guternet.de:

>> You have to use the net command in following manner:
>>
>> net use Y: \\SERVER\ShareName /persistent:no
>>
>> This will disconnect the drive, when the user logged out.
>
> Unfortunately, this works only with NT clients, since
> Win9x doesn't know the option /persistent:yes|no.
>
> Is there a way to get the desired result on both systems
> without using different user acoounts ?

Yes there is, but it needs some more elaboration...

<  y:\>type \\PDC\netlogon\logon.bat
<  @echo Versuche Zeit vom Server zu erhalten...
<  @if not "%logonserver%" == "\\XCNLM00S" net time \\xcnlm00s /set /yes >
NUL
<  @if "%OS%" == "Windows_98" goto osok
<  @if "%OS%" == "Windows_NT" goto osok
<  @if "%OS%" == "OS2_Warp4"  goto osok
<
<  @if "%WINDIR%" == ""       goto quit
<  @if "%WINBOOTDIR%" == ""   goto quit
<
<  @echo SET OS=Windows_98>> c:\autoexec.bat
<  @set OS=Windows_98
<
<  :osok
<  @if exist \\PDC\netlogon\%os%.cmd start \\PDC\netlogon\%os%.cmd >
c:\%os%.txt
<  @if exist \\PDC\netlogon\%os%.bat start \\PDC\netlogon\%os%.bat >
c:\%os%.txt
<
<  :quit
<  exit

While not all os have (like unix) a variable telling me what
os I am working on (Windows 9x) I'll set, for my convenience,
one after finding out what os my script is running on.

I use the same script for all those non unix clients ---
the disadvantage is: command-line-interpreters differ if you
use certain commands. You must make sure too keep the least
common level.

After having found out what os my scrip runs on I switch
to an other script doing the rest of the work.

--


More information about the samba-ntdom mailing list