Page 1 of 1 1
Topic Options
#142744 - 2005-07-01 12:37 AM windows Login Scripts in mixed environment
newtoo Offline
Fresh Scripter

Registered: 2005-07-01
Posts: 5
Hello,

I'm having a hard time makking all of my WINXP computer to work with my script. My win98 and win2k work great but not winxp, Please help...

@echo off
rem ************************************************************************
rem ** Logon batch file for RSI - located in netlogon share **
rem ** Homer 8/14/02 v1.0 **
rem ************************************************************************

rem ** Changes
rem RC1.01 none
rem RC1.02 Mapped win9x client home drive to m:
rem RC1.3 Added drive mappings for workgroup support
rem RC1.4 Added common drive mappings
rem v1.0 Changed JDE drive mapping to J: for all JDE Users

echo RSI Logon Script - v1.0

rem ** create logon script dir on client PC **
if not exist %windir%\_logon md %windir%\_logon >nul

echo Verifying Logon Script
xcopy /? > %windir%\_logon\_xcopy.txt
find /i "/Y" %windir%\_logon\_xcopy.txt > nul
if not errorlevel 1 goto xcopyy
xcopy %0\..\logon.flg %windir%\_logon /d > %windir%\_logon\_copytest.txt
if errorlevel 1 goto copyfail
goto filescopied
:xcopyy
xcopy %0\..\logon.flg %windir%\_logon /d /y > %windir%\_logon\_copytest.txt
if errorlevel 1 goto copyfail
:filescopied
find /i "0 file(s) copied" %windir%\_logon\_copytest.txt > nul
if not errorlevel 1 goto Local

rem ** copy self extracting zip file to local PC and extract local logon scripts **
echo Updating Logon Script
echo (may take a few minutes if connected via modem)
copy %0\..\_local.exe %windir%\_logon\_local.exe
if not exist %windir%\_logon\_local.exe goto copyfail
%windir%\_logon\_local.exe /auto %windir%\_logon
:delfile
del %windir%\_logon\_local.exe
if exist %windir%\_logon\_local.exe goto delfile
goto local

:copyfail
echo Logon Script Copy Failed
goto end

rem ** run local logon script located on client PC **
:Local
echo Processing Logon Script
call %windir%\_logon\local.bat

:end
echo Logon Script Finished
cd %windir%
echo.> %windir%\lmscript.$$$

Top
#142745 - 2005-07-01 12:47 AM Re: windows Login Scripts in mixed environment
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
This is a KiX forum and what you posted is DOS BATch, not KiX.

That and you don't say what doesn't work.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#142746 - 2005-07-01 12:54 AM Re: windows Login Scripts in mixed environment
StarwarsKid Offline
Seasoned Scripter
*****

Registered: 2005-06-15
Posts: 506
Loc: Oregon, USA
KiXtart is a very powerful scripting language that far surpasses the capability and flexibility of DOS BATch files. Is your intention to convert this script to KiX? (That would be highly recommended!) This forum is full of helpful peers who usually answer your questions (in one form or another) within minutes.

Welcome to the board! And provide more info like Les suggested.
_________________________
let the wise listen and add to their learning,
and let the discerning get guidance- Proverbs 1:5

Top
#142747 - 2005-07-01 01:17 AM Re: windows Login Scripts in mixed environment
newtoo Offline
Fresh Scripter

Registered: 2005-07-01
Posts: 5
thanks les/starwarskid....

the drive mapping does not work.

Top
#142748 - 2005-07-01 01:19 AM Re: windows Login Scripts in mixed environment
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
There is nothing in the code you posted that would map any drives.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#142749 - 2005-07-01 01:29 AM Re: windows Login Scripts in mixed environment
StarwarsKid Offline
Seasoned Scripter
*****

Registered: 2005-06-15
Posts: 506
Loc: Oregon, USA
That appears to be a conclusive diagnosis Dr.Les
_________________________
let the wise listen and add to their learning,
and let the discerning get guidance- Proverbs 1:5

Top
#142750 - 2005-07-01 01:32 AM Re: windows Login Scripts in mixed environment
StarwarsKid Offline
Seasoned Scripter
*****

Registered: 2005-06-15
Posts: 506
Loc: Oregon, USA
newtoo,

You may want to post the contents of local.bat if that is the BATch file that maps drive letters.
_________________________
let the wise listen and add to their learning,
and let the discerning get guidance- Proverbs 1:5

Top
#142751 - 2005-07-01 01:41 AM Re: windows Login Scripts in mixed environment
newtoo Offline
Fresh Scripter

Registered: 2005-07-01
Posts: 5
Les/starwarskid...

So sorry....here some more info.


@echo off
rem *********************************************************************
rem ** Logon batch file for RSI - located on local drive **
rem ** homer v1.0 **
rem *********************************************************************

rem Changes
rem Un remarked common drives and mapped r: to \\homeserver\volume1

rem ***********************************
rem ** SECTION 0 **
rem ** If logged on to Citrix Server **
rem ** skip rest of local.bat **
rem ***********************************

rem ** If connected via Citrix skip to endlocal**
echo %sessionname% > %windir%\_logon\_citrix.txt
find /i "echo" %windir%\_logon\_citrix.txt > nul
if errorlevel 1 goto endlocal

rem ************************
rem ** SECTION 1 **
rem ** Determine OS drive **
rem ************************

dir %windir%\_logon\*. > %windir%\_logon\_osdrv.txt
find /i "c:" %windir%\_logon\_osdrv.txt > nul
IF NOT errorlevel 1 goto os_cdrv
find /i "d:" %windir%\_logon\_osdrv.txt > nul
IF NOT errorlevel 1 goto os_ddrv
find /i "e:" %windir%\_logon\_osdrv.txt > nul
IF NOT errorlevel 1 goto os_edrv

s_cdrv
set osdrive=c:
goto maphome

s_ddrv
set osdrive=d:
goto maphome

s_edrv
set osdrive=e:
goto maphome


rem ********************
rem ** SECTION 2 **
rem ** Map Home Drive **
rem ********************

:maphome
ver > %windir%\_logon\_ver.txt

echo Mapping Home Drive

rem ** Record list of current drive mappings **
net use > %windir%\_logon\_use.txt

rem ** Find current Novell drive mappings ******
rem find /i "f:" %windir%\_logon\_use.txt > null
rem IF NOT errorlevel 1 goto wgdrives

rem ** Remove persistant drive mappings for common drives**
rem find /i "x:" %windir%\_logon\_use.txt > nul
rem IF NOT errorlevel 1 net use x: /d >nul
rem find /i "y:" %windir%\_logon\_use.txt > nul
rem IF NOT errorlevel 1 net use y: /d >nul
rem find /i "z:" %windir%\_logon\_use.txt > nul
rem IF NOT errorlevel 1 net use z: /d >nul

rem ** NT maps home drive automatically - no need to map **
find /i "Windows NT" %windir%\_logon\_ver.txt > nul
if not errorlevel 1 goto NThomesrv
find /i "Windows 2000" %windir%\_logon\_ver.txt > nul
if not errorlevel 1 goto NThomesrv
find /i "Windows XP" %windir%\_logon\_ver.txt > nul
if not errorlevel 1 goto NThomesrv


rem ** Delete and map m: drive to home directory on Win9x **
find /i "m:" %windir%\_logon\_use.txt > nul
IF NOT errorlevel 1 net use m: /d >nul
net use m: /home >nul
net use m: > %windir%\_logon\_home.txt
rem ** Test to see if error occurred mapping home drive **
find /i "2250" %windir%\_logon\_home.txt > nul
IF NOT errorlevel 1 goto homedrverr
goto mapdrives

rem ** Determine location of home server for NT PC **
:NThomesrv
echo %homeshare% > %windir%\_logon\_home.txt
rem ** Test to see if error occurred mapping home drive **
find /i "echo" %windir%\_logon\_home.txt > nul
IF NOT errorlevel 1 goto homedrverr
goto mapdrives

:homedrverr
echo No Home Drive in User Profile
echo Unable to Map Home Drive
echo Unable to Map Common Drives
goto wgdrives

rem ***************************************
rem ** SECTION 3 **
rem ** Map Common Drives to local Server **
rem ***************************************

** map common drives **
:mapdrives
echo Mapping Common Drives
%osdrive%
cd %windir%\_logon
kix32 mapdrv.scr $input=%windir%\_logon\_home.txt >nul
if errorlevel 1 echo Error Mapping Common Drives

rem ***********************************
rem ** SECTION 4 **
rem ** Maps workgroup drives based **
rem ** on Microsoft group membership **
rem ***********************************

rem ** map workgroup drives **
:wgdrives
echo Mapping Workgroup Drives
%osdrive%
cd %windir%\_logon
kix32 wgdrv.scr

:endlocal

Top
#142752 - 2005-07-01 11:26 PM Re: windows Login Scripts in mixed environment
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You should also post code within [CODE] tags. Also, you'll need to check the error level returned from the NET US statements if you want to find out why the script fails. You're also not saying whether the batch file drive mappings or the KiXtart drive mappings fail. Finally why the convoluted approack at all? It would be much cleaner to have everything taken care of within KiXtart. This would also give you more powerful debugging options.
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1636 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.077 seconds in which 0.051 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org