logon script won't run 
Author Message
 logon script won't run

My logon script will not run.  My network is Windows NT 4.0 service pack 4.
The workstation is Windows 2000 server.  First I created a VBScript (Listing
1), then created a wrap batch file (Listing 2).  I copied both files in the
Winnt\system32\repl\import\scripts of the PDC server.  I also copied it to
the BDC.  The commands on the wrap batch file are being processed, but the
script is not being processed.  What's wrong?  Please help.

Listing 1.-
(lognsbn.vbs) ---------------------------------------------------
'NSBN official logon script
'by Angel Martires

dim WSHShell, WshSysEnv, WSHNetwork
set WSHNetwork=Wscript.CreateObject("Wscript.Network")
set WshShell=Wscript.CreateObject("Wscript.Shell")
set WshSysEnv = WshShell.Environment("Process")

'Map network drives
WSHNetwork.MapNetworkDrive "H:","\\NSBN_FILES\TAXAPPS"
WSHNetwork.MapNetworkDrive "I:","\\NSBN_FILES\APPS"
WSHNetwork.MapNetworkDrive "J:","\\NSBN_FILES\DATA"
WSHNetwork.MapNetworkDrive "S:","\\NSBN_STOR\STORAGE"
WSHNetwork.MapNetworkDrive "N:","\\NSBN_STOR\NSBNOLD"
WSHNetwork.MapNetworkDrive "Q:","\\NSBN_STOR\BFCC_F"
WSHNetwork.MapNetworkDrive "R:","\\NSBN_STOR\BFCC_G"

strCulver = WshSysEnv("Culver")
If strCulver = "YES" Then
   WSHNetwork.MapNetworkDrive "K:","\\NSBN_GK\APPS"
else
   WSHNetwork.MapNetworkDrive "k:","\\NSBN_FILES\PROSYSTEM"
End If
----------------------------------------------------------------------------
--


NET TIME \\NSBN_FILES /SET /Y
cscript lognsbn.vbs
--------------------------------------------------------------------------



Sun, 18 May 2003 03:00:00 GMT  
 logon script won't run
No guarantees here, but I this is an excerpt from my own logon.bat file.  I
have W2000 Adv_Server and a W2000 Pro client.  the script works fine.

As long as you get the batch file to run, the vbs file should run as well.

Good luck.

Don Ireland
_______________________________________________
????????????????????????

Real happiness is cheap enough, yet how dearly we pay for its
counterfeit.
    -- Hosea Ballou

============================
Logon.bat
============================
start \\medina2\netlogon\login.vbs /w
net time \\Medina2 /set /yes>nul

============================
Logon.vbs
============================
Option Explicit

Dim oShell, oNet, oFSO, oWshNetwork, oGroupDict

'-----------------
                                       'Objects go here

Set oShell = CreateObject("Wscript.Shell")
Set oNet = CreateObject("Wscript.Network")
set oFSO = CreateObject("Scripting.FileSystemObject")

'-----------------
'all mapping and stuff is done from'here
'you should not have to change functions
'unless they do not work for some'reason

'you can put any combination of code in here
Set oDrives = oNet.EnumNetworkDrives
For i = 0 to oDrives.Count - 1 Step 2
  oNet.RemoveNetworkDrive oDrives.Item(i)
Next
oNet.MapNetworkDrive "g:", "\\Medina2\adm"
oNet.MapNetworkDrive "h:", "\\Medina2\exchange"
oNet.MapNetworkDrive "l:", "\\Medina2\medina"
oNet.MapNetworkDrive "p:", "\\Medina2\project"
oNet.MapNetworkDrive "s:", "\\Medina2\software"
oNet.MapNetworkDrive "y:", "\\Medina2\bat"

'If IsMember("MGMT") Then
'    oNet.MapNetworkDrive "m:", "\\Medina2\mgmt"
'End If



Sun, 18 May 2003 03:00:00 GMT  
 logon script won't run
I have the same problem too.  Sometimes my script runs and bombs during the
execution.  When I was running NT 4 and Win2K, it worked perfect.  As soon
as I applied the new Service pack to Win2K, my script fails to complete.  I
execute it with a call in a batch file.

Joe


Quote:
> No guarantees here, but I this is an excerpt from my own logon.bat file.
I
> have W2000 Adv_Server and a W2000 Pro client.  the script works fine.

> As long as you get the batch file to run, the vbs file should run as well.

> Good luck.

> Don Ireland
> _______________________________________________
> ????????????????????????
>

> Real happiness is cheap enough, yet how dearly we pay for its
> counterfeit.
>     -- Hosea Ballou

> ============================
> Logon.bat
> ============================
> start \\medina2\netlogon\login.vbs /w
> net time \\Medina2 /set /yes>nul

> ============================
> Logon.vbs
> ============================
> Option Explicit

> Dim oShell, oNet, oFSO, oWshNetwork, oGroupDict

> '-----------------
>                                        'Objects go here

> Set oShell = CreateObject("Wscript.Shell")
> Set oNet = CreateObject("Wscript.Network")
> set oFSO = CreateObject("Scripting.FileSystemObject")

> '-----------------
> 'all mapping and stuff is done from'here
> 'you should not have to change functions
> 'unless they do not work for some'reason

> 'you can put any combination of code in here
> Set oDrives = oNet.EnumNetworkDrives
> For i = 0 to oDrives.Count - 1 Step 2
>   oNet.RemoveNetworkDrive oDrives.Item(i)
> Next
> oNet.MapNetworkDrive "g:", "\\Medina2\adm"
> oNet.MapNetworkDrive "h:", "\\Medina2\exchange"
> oNet.MapNetworkDrive "l:", "\\Medina2\medina"
> oNet.MapNetworkDrive "p:", "\\Medina2\project"
> oNet.MapNetworkDrive "s:", "\\Medina2\software"
> oNet.MapNetworkDrive "y:", "\\Medina2\bat"

> 'If IsMember("MGMT") Then
> '    oNet.MapNetworkDrive "m:", "\\Medina2\mgmt"
> 'End If



Thu, 22 May 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Logon Script won't run in Windows 98

2. Logon Date/Time Script Won't Run

3. Logon Date/Time Script Won't Run

4. Simple script won't run on certain user's PC

5. Ghostscript won't run from script.

6. VBS Scripts won't run, bad association?

7. Remote Admin Scripts won't run

8. scripts won't run on 2k prof

9. Script won't run with WSCRIPT/CSCRIPT

10. Scripts won't run in XP

11. Login Script won't Run

12. script won't run....Please help!

 

 
Powered by phpBB® Forum Software