Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

logon script error 80070055 2

Status
Not open for further replies.

somedea

MIS
Jul 13, 2004
162
US
I'm a novice at writing logon scripts. I'm trying to map all my Win XP and Win2000 users to a new network drive using group policy on my 2003 PDC. I used the following script to map the drive and placed it in the C:\windows\sysvol\sysvol\(mydomain)\scripts folder on the PDC. I then edited the domain group policy to use this logon script in the ComputerConfiguration\WindowsSettings\Scripts\(Startup/Shutdown\startup AND in the User Configuration\Windows Settings\Scripts (logon\logoff)\logon.
It is a new drive letter, never used before.
The first day, it worked fine, but every day after, we get an error message that the local device name is already in use (error 80070055) Although, if we ignore this, the drive shows in My Computer as disconnected, but it works.

Do I need a logoff script too? Should I not have put the script in both Windows and User Settings, OR do I need somekind of IF in the script? Here is the script:

Dim objNet

Set objNet = CreateObject("Wscript.Network")

objNet.MapNetworkDrive "J:", "\\mydomain\jobs"
WSCript.Quit
Thanks in advance for any light you can shed on this!
 
The script will load twice if you have it in bth the Computer Config & the User Configuration. You only need it in the user config.
 
Drives stay mapped between logon seession. What is happening is that they are trying to map a drive that they already have mapped (from when your scrip mapped it the first time).

When mapping a drive using a logon script you want to make sure you unmap that drive letter first.



Dim objNet

Set objNet = CreateObject("Wscript.Network")
objNet.removenetworkdrive "J:"
objNet.MapNetworkDrive "J:", "\\mydomain\jobs"
WSCript.Quit
 
Thanks for the replies. I tried taking the script out of Computer Config,as ashpp suggests, logged on with same error.
I tried adding the remove line to my script, as MoobyCow sugests, got a line 4 (the remove line) error that the drive doesn't exist. I also can't disconnect the mapped drive, because it shows as disconnected in MyComputer, even though double clicking it will take you to the mapped drive.
Do I need a "remove IF the drive exists" line in the script?
 
> Drives stay mapped between logon seession

On if they are computer config scripts, you don't need to unmap if they are in the user config.

somedea >

Again get rid of the computer script, and only use the user one. Try this script and all should work.

On Error Resume Next
Dim objNet

Set objNet = CreateObject("Wscript.Network")

objNet.MapNetworkDrive "J:", "\\mydomain\jobs","false"
WSCript.Quit
 
That worked! The drive still shows up in my computer as disconnected, but everything works and no more error message at logon. Can you recommend a good place to learn about scripting?
Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top