Re: Vista Logon Script

Tech-Archive recommends: Fix windows errors by optimizing your registry



Sorry, I haven't worked with Vista yet. Maybe others have. Does it help if
you use?

Set WSHNetwork = CreateObject("WScript.Network")

Perhaps the Wscript object is not allowed. Also, you might try to trap the
error and code something to indicate the error. Perhaps:
=============
On Error Resume Next
Set WSHNetwork = CreateObject("WScript.Network")
If (Err.Number <> 0) Then
Call MsgBox("Error number: " & Err.Number _
"Description: " & Err.Description _
"Source: " & Err.Source)
End If
Err.Clear
WSHNetwork.MapNetworkDrive "G:", "\\SERVER\SHARE"
If (Err.Number <> 0) Then
Call MsgBox("Error number: " & Err.Number _
"Description: " & Err.Description _
"Source: " & Err.Source)
End If
On Error GoTo 0
=========
At least this will give you a clue as to which statement is the problem, and
what the error message might be. The person logging on should see the
message boxes.

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net

"randyh@xxxxxxxxxxxxxxxxx"
<randyhnewsgroupsnospam@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DCE09B17-D6DF-48DD-A44C-E4E12F5E7E58@xxxxxxxxxxxxxxxx
These scripts work fine with XP. Here is a sample of what doesn't work:

Set WSHNetwork = WScript.CreateObject("WScript.Network")
WSHNetwork.MapNetworkDrive "G:", "\\SERVER\SHARE"

As I said previously the scripts work if I run them after logging on, just
not when run from a logon script.

Thanks,
Randy

"Richard Mueller" wrote:

I am working with the RTM release of Vista trying to get my
organization's
logon/logoff scripts working. I have found one problem that I need some
assistance with.

One of our logon scripts maps drives based on group membership. It
works
fine in Vista if it is ran once a user is fully logged in but does not
work
when ran via the logon script. I have tried the following things:

- Map the drive using WScript.Network.MapNetworkDrive.
- Map the drive using "net use".
- Making the script sleep for 30 seconds before mapping the drives.

Can you post a snippet of your script that duplicates the problem? Also,
does the script run correctly as a logon script on XP or W2k clients?

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net





.



Relevant Pages

  • Re: MapNetworkDrive not working during first logon
    ... is mapped automatically as part of the users profile. ... if I open a command prompt and switch to one of the mapped drives I ... script runs I get the popup message ... No path is specified for the logon script itself. ...
    (microsoft.public.scripting.vbscript)
  • RE: Drive map issues after SP1
    ... There was never a /persistent:yes in the script - I had to add the ... the logon script will try to map the drive again. ... > before the map drive command to delete all the mapped drives: ...
    (microsoft.public.windows.server.sbs)
  • Re: Need help
    ... According to the description, you want a logon script to map drive letters ... Migration of Novell to MicrosoftTo boil down if you need to ... Scripts/Mapped Drives: Every Novell environment I have ever ... ...
    (microsoft.public.windows.server.migration)
  • Re: User Scripts
    ... users will not have their shared drives, ... dont have any others, try a basic script, maybe adding a printer, to see ... Also one other fix is to reboot the machine 3 ... then add the bat file name to the logon script text field. ...
    (microsoft.public.windows.server.active_directory)
  • Re: MapNetworkDrive not working during first logon
    ... Here is the code that I use to map conditional network drives. ... script runs I get the popup message ... No path is specified for the logon script itself. ...
    (microsoft.public.scripting.vbscript)