Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logon scripts - batch files 1

Status
Not open for further replies.

wafer157

IS-IT--Management
Feb 17, 2005
26
US
Hello,
My first admission is that I know very little about scripting/batch files. Given that here is the question. We have a mixed desktop environment - win 98, 2000 and xp all running in a windows 2000 server domain. We have putinenv L and winset.exe in the netlogon and scripts folder.

We have a large # of students logging into widows 98 systems. The logon script maps the drive to the users folder. The problem is twofold. First, some of the 98 machines do not show the mapped drive/student folder. Second, when they log onto an XP machine we get the winset error and the mapped drive is "access denied". We have checked the folders privilages many times.

What is just as frustrating is that some students are logging in fine with the same script. I have included a copy of the bat file. Any suggestions would be helpful.
Thanks,

PS - It is a learning curve on my part so any good resouces or web sites would help too.


REM *** STUDENT LOGIN SCRIPT FILE ***

@echo off

@NET TIME \\server_name/DOMAIN:NAME/SET /YES

if %os%==Windows_2000 goto END
if %os%==Windows_XP goto END

\\server_name\netlogon\putinenv L
\\server_name\netlogon\winset username=%username%
\\server_name\netlogon\winset langroup=%langroup%


@Rem // Create new
@net use h: \\sever_name\%username%$
:end
 
One mistake I noticed right away -

Both 2000 and XP report %os% as Windows_NT , not Windows_2000 or Windows_XP .

Easy check, open a command line and enter - echo %os%

Way I would do it -

set servername= <whatever you want>
@echo off
if "%os%"=="Windows_NT" goto end
net time /DOMAIN:<name> /set /yes
net use h: \\%servername%\%username%
:end

Or something along those lines.

Check Microsofts site if i remember correctly there is a fix you have to apply to Windows 98 machines to allow them to login and run login scripts correctly. I believe its also on the Win 2000 CD.

 
Weescotty,
Thank you - adding the nt line worked. Now that I look at the script I can't believe I missed something like that. Always good to have another set of "eyes". Thanks again.
 
Windows 98 won't pass the %username% variable, IIRC.

Pat Richard, MCSE(2) MCSA:Messaging, CNA(2)
 
58sniper, to use variables like %username% there are 'putinenv' and 'winset' used in this script.

===
Karlis
ECDL; MCSA
 
wafer157, I realize by the fact that you mention STUDENTS that you are in a school environment and probably have limited resources. That said, you really NEED to get rid of the 98 boxes. They are a huge security risk. The Windows Meta File vulnerability is not patched on then adn never will be. MS has retired all support for the product and as such it no longer gets security patches.

Schools get such great discounts on the cost of an upgrade OS, I would recommend doing all in your power to get these machines either retired or upgraded.

I hope you find this post helpful.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top