Page 1 of 1 1
Topic Options
#203749 - 2011-11-16 05:33 PM Windows XP and Windows 7
MasterB Offline
Fresh Scripter

Registered: 2009-08-21
Posts: 12
Loc: Kentucky
We run a mixed environment of XP and 7 machines. During the initial deployment at my site, I created a script to map the network drives. The script was placed in \\servername\NETLOGON\Sites\HEB\Startup... called win_7.vbs

It runs when a user logs in, which is in bold and underlined below:

 Code:
@echo off
Echo ArvinMeritor Logon Script

VER | find "NT" > nul 
   IF not errorlevel 1 GOTO Win_NT 

VER | find "2000" > nul 
   IF not errorlevel 1 GOTO Win_NT 

VER | find "XP" > nul 
   IF not errorlevel 1 GOTO Win_NT 

VER | find "98" > nul 
   IF not errorlevel 1 GOTO Win_9X 

VER | find "95" > nul 
   IF not errorlevel 1 GOTO Win_9X 

VER | find "5.2.3790" > nul 
   IF not errorlevel 1 GOTO Win_NT

VER | find "6.1" > nul
   IF not errorlevel 1 GOTO Win_7

GOTO unknown_os 

:win_NT 
   IF EXIST %WINDIR%\KIX32.EXE CALL %WINDIR%\KIX32.EXE %logonserver%\netlogon\KIXTART.KIX && GOTO END
   IF NOT EXIST %WINDIR%\KIX32.EXE COPY %logonserver%\netlogon\KIX\K*.* %windir%\
   CALL %WINDIR%\KIX32.EXE %logonserver%\netlogon\KIXTART.KIX
GOTO END

[u][b]:win_7
   IF Exist %logonserver%\netlogon\sites\HEB\Startup\win_7.vbs START %logonserver%\netlogon\sites\HEB\Startup\win_7.vbs
GOTO END[/b][/u]

:win_9X 
   IF EXIST %WINDIR%\KIX32.EXE CALL %WINDIR%\KIX32.EXE %0\..\KIXTART.KIX
   IF NOT EXIST %WINDIR%\KIX32.EXE CALL %0\..\KIX\KIX32.EXE %0\..\KIXTART.KIX
GOTO END


:LOCAL_APPS

;Add OCS to PC

SHELL \\chkfp001\data\OCS_INSTALL\unatt_inst_cmd

RETURN

:unknown_os
:end


While this works fine, we now have another site that is on Windows 7 and XP. The directory \\servername\NETLOGON is replicated to the other AD. So when the TPL OU users login with their Windows 7 machine, their drives are mapped to our HEB drives.

I have looked all over the place and cant find an answer. As of right now I dont have access the GP so I need to make this work for both sides TPL and HEB.

This is the HEB site below:

 Code:
;**** Last Modified on 11:57 AM 2/23/2004 by nortonjr****
;**** Last Modified on 3:53 PM 04/08/2004 by wyattre****
;**** Last Modified on 4:12 PM 3/9/2007 by kendaljl ****
;**** Last Modified on 12:57PM 4/20/2007 by landjr ****
;**** Last Modified on 12:57PM 12/4/2008 by landjr ****
;**** Last Modified on 12:57PM 3/2/2009 by landjr ****
;**** Last Modified on 10:07PM 4/28/2009 by landjr ****
;**** Last Modified on 6/17/2009 by landjr ****
;**** Last Modified on 9/28/2011 by landjr ****



GOSUB MAPDRIVES
;GOSUB WIN_XP




:MAPDRIVES


CLS
Color Y+/n

AT (20,15) "Mapping Department Drives and Checking Norton AntiVirus Status..."
AT (24,79)




$HOMEDIR=@UserID + "$"

USE H: /DEL
USE H: "\\HEBFPS01\$HOMEDIR"


USE N: /DEL
USE Q: /DEL
USE R: /DEL
USE S: /DEL
USE G: /DEL
USE T: /DEL


USE N: "\\USAHSARMP038\Dshares\SAP\Documents"
USE Q: "\\HEBFPS01\QS9000"
USE R: "\\HEBFPS01\DSHARES"
USE S: "\\USAHSARMP038\GSHARES"
USE G: "\\HEBSOFTWARE001\APPS"
USE x: "\\HEBFPS01\NETWORK_SCANNING"

COPY "\\hebads007\sysvol\na.autoedir.com\scripts\sites\HEB\Desktop" %userprofile%\Desktop\

COPY "\\hebads007\sysvol\na.autoedir.com\scripts\sites\HEB\Favorites" %userprofile%\Favorites\





IF INGROUP ("HEBxWin7")
      USE Y: /DEL
      USE Y: "\\Hebcom01\loftware$\WDDrop"





IF INGROUP ("HEBxWDDrop")
      USE Y: /DEL
      USE Y: "\\Hebcom01\loftware$\WDDrop"

END IF




ENDIF

:END


This is the TPL site below:

 Code:
;**** Last Modified on 8/7/2008 by zhovney ****
;**** Last Modified on 12/4/2008 by Jason Land ****
;**** Last Modified on 6/17/2009 by Jason Land ****
;**** Last Modified on 8/19/2009 by landjr ****

; ***********************************************
; *          BODY OF LOCAL LOGON SCRIPT         *
; ***********************************************
;
GOSUB MAPDRIVES
If InStr(@WKSTA, "CITWTS")
   OR InStr(@WKSTA, "CITTS") 
   OR InStr(@WKSTA, "TRYWTS")
   GOTO END
EndIf
GOSUB INSTALL_SAV
GOSUB LOCAL_APPS
;GOSUB INSTALL_SUS
;GOSUB SUSVER
;GOSUB WIN_2000
;GOSUB WIN_XP
GOSUB UNKNOWN_OS
GOSUB SUSOFF

; **********************************************
; * MAP SITE SPECIFIC DRIVES		       *
; **********************************************

:MAPDRIVES

CLS
AT (20,15) "Mapping Department Drives and Checking Symantec AntiVirus Status..."
AT (24,79)

USE T: /DEL
USE T: "\\USAHSARMP038\Transfer" 
  
      
$HOMEDIR=@UserID

USE G: /DEL
USE H: /DEL
USE N: /DEL
USE Q: /DEL
USE R: /DEL
USE S: /DEL
USE X: /DEL

USE G: "\\USAHSARMP038\Apps"
USE H: "\\USAHSARMP038\users\$HOMEDIR"
USE N: "\\USAHSARMP038\Dshares\SAP\Documents"
USE Q: "\\HEBfpS01\QS9000"
USE R: "\\USAHSARMP038\DShares"
USE S: "\\USAHSARMP038\GShares"
USE X: "\\USAHSVUAM163\Scan\Wabco_Scan"

COPY "\\tryads006\sysvol\na.autoedir.com\scripts\sites\HEB\Desktop" %userprofile%\Desktop\

COPY "\\tryads006\sysvol\na.autoedir.com\scripts\sites\HEB\Favorites" %userprofile%\Favorites\

If InGroup ("tplxtestgroup")
      Use I: /Del
      Use I: "\\usahsarmp038\Gshares\TestGroup"
EndIf


      

RETURN

; **********************************************
; * INSTALL SAV SPECIFIC TO THE SITE           *
; **********************************************
:INSTALL_SAV

SHELL \\USAHSARMP038\VPLOGON\VPLOGON.BAT

RETURN

; **********************************************
; * INSTALL APPLICATIONS SPECIFIC TO THE SITE  *
; **********************************************

:LOCAL_APPS


RETURN


; **********************************************
; * INSTALL/VERIFY SUS INSTALLATION            *
; **********************************************

:INSTALL_SUS

Color y+/n
      $SUSSERVER = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\","WUServer")
If $SUSSERVER = "http://nasus.arvinmeritor.com/"
AT (15,10)
 "SUS SERVER ="
AT (15,23) "$SUSSERVER"
GOTO END
      Else
AT (16,10) 
Color y+/n
       "Verifying SUS Client..."
GOTO SUSVER
ENDIF

:SUSVER

Color y+/n
$WINVER = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion","CurrentVersion")
If $WINVER = "5.0"
AT (17,10)
"Windows 2000 Detected"
GOTO WIN_2000
ELSE
IF $WINVER = "5.1"
AT (17,10)
"Windows XP Detected"
GOTO WIN_XP
ELSE
GOTO UNKNOWN_OS

:WIN_2000
AT (18,10)
;Use Z: /DEL
;Use Z:    "\\TRYSMS001\PACKAGES"
"Installing SUS Services...      "
SHELL "%logonserver%\netlogon\SUS\TRY\W2K\SUSUpdateW2k2.EXE"
;Use Z: /DEL
GOTO END

:WIN_XP
AT (18,10)
;Use Z: /DEL
;Use Z:    "\\TRYSMS001\PACKAGES"
 "Installing SUS Services...      "
SHELL "%logonserver%\netlogon\SUS\TRY\WXP\SUSUpdateXP.EXE"
;Use Z: /DEL
GOTO END


:UNKNOWN_OS
GOTO END

:END







What do I need to do to get this rolling? Thanks!

Top
#203750 - 2011-11-16 05:42 PM Re: Windows XP and Windows 7 [Re: MasterB]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4557
Loc: USA
I'm not sure I understand the question or why you have different scripts. I have one script for each of my customers and it works for any modern OS (XP,Vista,7). Obviously there are some issues with x86 and x64 and a few path changes, but those are easily worked around.

Are you still supporting legacy OSs?

Care to elaborate?

Top
#203751 - 2011-11-16 05:58 PM Re: Windows XP and Windows 7 [Re: Allen]
MasterB Offline
Fresh Scripter

Registered: 2009-08-21
Posts: 12
Loc: Kentucky
Alright... I manage two OU's, HEB and TPL.

Before XP the drive mappings were not an issue. Now that we have both XP and 7 at both sites, drive mappings are an issue.

The original drive mappings didnt work with Windows 7 which is why I made the vb script. At the time it was only HEB that had Windows 7 so we hadnt had any issues. But now both sites have XP and 7, its a big issue.

We also have 32 and 64 bit XP and 7.


We have different scripts because each site uses different network drives. If both sites used the same drives, I wouldnt have any issue.

Top
#203752 - 2011-11-16 06:04 PM Re: Windows XP and Windows 7 [Re: MasterB]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4557
Loc: USA
I think you eluded to this being run as a GPO startup script. If so you have two options to "fix" the issues with Windows 7 (and Vista).

The easy fix is deploy a reg hack. Unfortunately it is not supported by Microsoft and lowers the security of the pc.

The second option, while not difficult, is to map the drives in the context of the user.

See if this link provides you with the info you need: http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=198514#Post198514

Top
#203753 - 2011-11-16 06:10 PM Re: Windows XP and Windows 7 [Re: Allen]
MasterB Offline
Fresh Scripter

Registered: 2009-08-21
Posts: 12
Loc: Kentucky
I tried the EnableLinkedConnections and it didnt work, tried 32bit dword and 64bit dword.

Im still fairly new at this since Im basically on my own.

The link you gave, where do I put that so I can test it on my machine?

Top
Page 1 of 1 1


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

Who's Online
0 registered and 323 anonymous users online.
Newest Members
Audio, Hoschi, Comet, rrosell, PatrickPinto
17880 Registered Users

Generated in 0.125 seconds in which 0.099 seconds were spent on a total of 13 queries. Zlib compression enabled.

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