I am in a windows 2000 server environment with 50% of the PC's Win98 and the other 50% NT/XP.I am trying to add a vbs script that was written to audit PC's if users are in the "audit" group. I am very new at this but it appears that my batch file is designed to determine OS and determine if Virus Protection is installed (if not, install) and also map drives. If the OS in 98 I believe Kix32 runs a script. Without messing anything up I would like to get the VBS script to run for all the users in the audit group. Should I just put in "run audit.vbs" script in my logon bat file? Any ideas would be greatly appreciated. I will paste each script here for reference. It appears to me that having all these different formats is more confusing than it needs to be. I am not sure where to start. Thank-you.
Login Script. Batchfile
@Echo Off
@Echo aspen Windows 2000 Logon Process Version 1.2 Initiating
Rem ----------------------------------------------------------
Rem For all users that not in the HR or Finance Group
Rem This script will not connect to K:\Specific share
Rem __________________________________________________________
if "%OS%" == "windows_98" goto win_98
:win_98
ause
@SET LANG=ENU
@SET FILE_SERVER=aspen_HR
@ECHO OFF
REM *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
REM
REM VPLOGIN.BAT
REM Description: Client login script file for Windows NT Servers running
REM Norton AntiVirus Corporate Edition
REM
REM *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
REM %0\..\NBPSHPOP +T: \\%FILE_SERVER%\vplogon
if "%OS%" == "Windows_NT" goto WINNT_NBPSHPOP
%0\..\NBPSHPOP +T: \\%FILE_SERVER%\vplogon
goto MOVEON
:WINNT_NBPSHPOP
NBPSHPOP +T: \\%FILE_SERVER%\vplogon
:MOVEON
T:\OSVER
IF ERRORLEVEL 2 GOTO WIN_32
GOTO 16BIT
REM *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
:WIN_32
T:\VP_Log32 /p=T:
GOTO END
REM =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
:16BIT
T:\VP_Log16 /l=%LANG% /p=T:\ /n=4
REM =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
:END
rem %0\..\NBPSHPOP -T:
if "%OS%" == "Windows_NT" goto WINNT_NBPSHPOP_END
%0\..\NBPSHPOP -T:
goto MOVEON_END
:WINNT_NBPSHPOP_END
NBPSHPOP -T:
:MOVEON_END
ause
IF %DEBUG%. == . GOTO Normal
ECHO Running %0 in debug mode
:Normal
@Echo Determine operating environment
:: Determine operating environment
if "%processor_architecutre%"=="x86" Set OS=Windows_NT
if NOT "%winbootdir%."=="." Set OS=WIN_95
if .%comspec% == . set comspec=c:\command.com
:: Script Name
Set Script=%0\..\aspen
:: Script Directory
Set SCRDIR=C:\aspen
Goto %OS%
:Windows_NT
@Echo Update NT Script Files, Please Wait...
Echo Mapping Network Drives - J: N: P:
Net use J: /d > nul
Net Use J: \\HQMAIN1\Apps
Net use N: /d > nul
Net use N: \\HQMAIN1\aspenData
Net use P: /d > nul
Net use P: \\HQMAIN1\Public
Goto ENDCOMMON
:WIN_95
@Echo Update Windows 95/98 Script Files, Please Wait...
If not exist %SCRDIR% MD %SCRDIR% > nul
if not exist %SCRDIR%\kix32.exe xcopy \\HQMaindc1\netlogon\aspen\*.* %SCRDIR% /E /I /Y > nul
if not exist %windir%\system\kx16.dll xcopy %SCRDIR%\*.dll %windir%\system /E / I /Y >nul
echo %username%
echo %SCRDIR%\Kix32.exe %SCRDIR%\aspen.SCR
%SCRDIR%\Kix32.exe %SCRDIR%\aspen.SCR
Echo Mapping Network Drives - J: N: P: K:
net use J: /d >nul
Net Use J: \\HQMAIN1\Apps
net use N: >nul
Net use N: \\HQMAIN1\aspenData
Net use P: /d
Net use P: \\HQMAIN1\Public
Echo Mapping Home Directory for User - H:
echo %homedir%
Net use H: %homedir% > nul
xcopy C:\aspen\Home95.bat %Windir%\"Start Menu"\Programs\Startup\*.* /E /I /Y >nul
Goto ENDCOMMON
:ENDCOMMON
@Echo ..........
Echo Sychronize time on workstation to master time server - HQMAINDC1
Net time \\HQMAINDC1 /Set /Y >nul
@Echo aspen Windows 2000 Logon Process Version 1.2 Complete
Exit
**********************************************************
Here is the Kix Script
Shell "winset.exe USERNAME=@USERID"
Shell "Winset.exe COMPUTER=@WKSTA"
Shell "Winset.exe DOMAIN=@DOMAIN"
Shell "Winset.exe FULLNAME=@FULLNAME"
Shell "Winset.exe HOMEDIR=@HOMEDIR"
Shell "Winset.exe LSERVER=@LSERVER"
Exit
Here is the VBS script I want to add
Set WshShell = WScript.CreateObject("WScript.Shell"
Set WshNetwork = WScript.CreateObject("WScript.Network"
WScript.Echo "Preparing to audit the machine"
'<package>
'<job id="TestXML">
'<script language="vbscript">
on error resume Next
Set objReg = WScript.CreateObject("WScript.Shell"
AUDIT = objReg.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Blue Ocean Software, Inc.\Track-It!\Audit\data"
If err.number <> 0 then
x = "1"
y = err.description
z = z & " regread"
End If
oldRegStr = Split(audit,"|"
ws = oldRegStr(0)
name = oldRegStr(1)
pos = oldRegStr(2)
dept = oldRegStr(3)
dept_num = oldRegStr(4)
phone = oldRegStr(5)
p_ext = oldRegStr(6)
modem = oldRegStr(7)
m_ext = oldRegStr(8)
fax = oldRegStr(9)
fax_ext = oldRegStr(10)
location = oldRegStr(11)
network = oldRegStr(12)
id1 = oldRegStr(13)
id2 = oldRegStr(14)
id3 = oldRegStr(15)
id4 = oldRegStr(16)
id5 = oldRegStr(17)
id6 = oldRegStr(18)
comments = oldRegStr(19)
email = oldRegStr(22)
newRegStr = ws + "|" + name + "|" + pos + "|" + phone + "|" + fax + "|" + fax_ext + "|" + p_ext + "|" + email + "|" + dept + "|" + dept_num + "|" + location + "|" + network + "|" + id1 + "|" + id2 + "|" + id3 + "|" + id4 + "|" + id5 + "|" + id6 + "|" + comments + "|"
If AUDIT <> "" then
objReg.RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Blue Ocean Software, Inc.\Track-It!\Audit\PromptData"
, newRegStr
End If
on error Goto 0
'</script>
'</job>
'</package>
AA = WshNetwork.computerName
A = Len(WshNetwork.ComputerName)
If A = 7 then
C = Right(AA, 4)
'WScript.Echo C
Else
C = Right(AA, 5)
'WScript.Echo C
end If
theString = "\\main2\tiw4std\audit32.exe " + c
wshshell.Run "command /C \\main2\tiw4std\audit32.exe TIA="+CStr(c), 6
Login Script. Batchfile
@Echo Off
@Echo aspen Windows 2000 Logon Process Version 1.2 Initiating
Rem ----------------------------------------------------------
Rem For all users that not in the HR or Finance Group
Rem This script will not connect to K:\Specific share
Rem __________________________________________________________
if "%OS%" == "windows_98" goto win_98
:win_98
@SET LANG=ENU
@SET FILE_SERVER=aspen_HR
@ECHO OFF
REM *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
REM
REM VPLOGIN.BAT
REM Description: Client login script file for Windows NT Servers running
REM Norton AntiVirus Corporate Edition
REM
REM *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
REM %0\..\NBPSHPOP +T: \\%FILE_SERVER%\vplogon
if "%OS%" == "Windows_NT" goto WINNT_NBPSHPOP
%0\..\NBPSHPOP +T: \\%FILE_SERVER%\vplogon
goto MOVEON
:WINNT_NBPSHPOP
NBPSHPOP +T: \\%FILE_SERVER%\vplogon
:MOVEON
T:\OSVER
IF ERRORLEVEL 2 GOTO WIN_32
GOTO 16BIT
REM *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
:WIN_32
T:\VP_Log32 /p=T:
GOTO END
REM =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
:16BIT
T:\VP_Log16 /l=%LANG% /p=T:\ /n=4
REM =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
:END
rem %0\..\NBPSHPOP -T:
if "%OS%" == "Windows_NT" goto WINNT_NBPSHPOP_END
%0\..\NBPSHPOP -T:
goto MOVEON_END
:WINNT_NBPSHPOP_END
NBPSHPOP -T:
:MOVEON_END
IF %DEBUG%. == . GOTO Normal
ECHO Running %0 in debug mode
:Normal
@Echo Determine operating environment
:: Determine operating environment
if "%processor_architecutre%"=="x86" Set OS=Windows_NT
if NOT "%winbootdir%."=="." Set OS=WIN_95
if .%comspec% == . set comspec=c:\command.com
:: Script Name
Set Script=%0\..\aspen
:: Script Directory
Set SCRDIR=C:\aspen
Goto %OS%
:Windows_NT
@Echo Update NT Script Files, Please Wait...
Echo Mapping Network Drives - J: N: P:
Net use J: /d > nul
Net Use J: \\HQMAIN1\Apps
Net use N: /d > nul
Net use N: \\HQMAIN1\aspenData
Net use P: /d > nul
Net use P: \\HQMAIN1\Public
Goto ENDCOMMON
:WIN_95
@Echo Update Windows 95/98 Script Files, Please Wait...
If not exist %SCRDIR% MD %SCRDIR% > nul
if not exist %SCRDIR%\kix32.exe xcopy \\HQMaindc1\netlogon\aspen\*.* %SCRDIR% /E /I /Y > nul
if not exist %windir%\system\kx16.dll xcopy %SCRDIR%\*.dll %windir%\system /E / I /Y >nul
echo %username%
echo %SCRDIR%\Kix32.exe %SCRDIR%\aspen.SCR
%SCRDIR%\Kix32.exe %SCRDIR%\aspen.SCR
Echo Mapping Network Drives - J: N: P: K:
net use J: /d >nul
Net Use J: \\HQMAIN1\Apps
net use N: >nul
Net use N: \\HQMAIN1\aspenData
Net use P: /d
Net use P: \\HQMAIN1\Public
Echo Mapping Home Directory for User - H:
echo %homedir%
Net use H: %homedir% > nul
xcopy C:\aspen\Home95.bat %Windir%\"Start Menu"\Programs\Startup\*.* /E /I /Y >nul
Goto ENDCOMMON
:ENDCOMMON
@Echo ..........
Echo Sychronize time on workstation to master time server - HQMAINDC1
Net time \\HQMAINDC1 /Set /Y >nul
@Echo aspen Windows 2000 Logon Process Version 1.2 Complete
Exit
**********************************************************
Here is the Kix Script
Shell "winset.exe USERNAME=@USERID"
Shell "Winset.exe COMPUTER=@WKSTA"
Shell "Winset.exe DOMAIN=@DOMAIN"
Shell "Winset.exe FULLNAME=@FULLNAME"
Shell "Winset.exe HOMEDIR=@HOMEDIR"
Shell "Winset.exe LSERVER=@LSERVER"
Exit
Here is the VBS script I want to add
Set WshShell = WScript.CreateObject("WScript.Shell"
Set WshNetwork = WScript.CreateObject("WScript.Network"
WScript.Echo "Preparing to audit the machine"
'<package>
'<job id="TestXML">
'<script language="vbscript">
on error resume Next
Set objReg = WScript.CreateObject("WScript.Shell"
AUDIT = objReg.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Blue Ocean Software, Inc.\Track-It!\Audit\data"
If err.number <> 0 then
x = "1"
y = err.description
z = z & " regread"
End If
oldRegStr = Split(audit,"|"
ws = oldRegStr(0)
name = oldRegStr(1)
pos = oldRegStr(2)
dept = oldRegStr(3)
dept_num = oldRegStr(4)
phone = oldRegStr(5)
p_ext = oldRegStr(6)
modem = oldRegStr(7)
m_ext = oldRegStr(8)
fax = oldRegStr(9)
fax_ext = oldRegStr(10)
location = oldRegStr(11)
network = oldRegStr(12)
id1 = oldRegStr(13)
id2 = oldRegStr(14)
id3 = oldRegStr(15)
id4 = oldRegStr(16)
id5 = oldRegStr(17)
id6 = oldRegStr(18)
comments = oldRegStr(19)
email = oldRegStr(22)
newRegStr = ws + "|" + name + "|" + pos + "|" + phone + "|" + fax + "|" + fax_ext + "|" + p_ext + "|" + email + "|" + dept + "|" + dept_num + "|" + location + "|" + network + "|" + id1 + "|" + id2 + "|" + id3 + "|" + id4 + "|" + id5 + "|" + id6 + "|" + comments + "|"
If AUDIT <> "" then
objReg.RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Blue Ocean Software, Inc.\Track-It!\Audit\PromptData"
End If
on error Goto 0
'</script>
'</job>
'</package>
AA = WshNetwork.computerName
A = Len(WshNetwork.ComputerName)
If A = 7 then
C = Right(AA, 4)
'WScript.Echo C
Else
C = Right(AA, 5)
'WScript.Echo C
end If
theString = "\\main2\tiw4std\audit32.exe " + c
wshshell.Run "command /C \\main2\tiw4std\audit32.exe TIA="+CStr(c), 6