Computer Performance, Windows 2003, Exchange 2003, Logon Scripts

Code Error 800704B0 - The specified device name is invalid

Troubleshooting Code 800704B0 - The specified device name is invalid

Introduction to Code 800704B0

This error code, 800704B0 usually occurs when you try to map a network drive with a VBScript.  WSH is probably using a method called MapNetworkDrive or AddPrinterConnection.   Here is a wild guess, you have omitted the : (colon) on the Drive letter e.g. it should be = "M:" but you entered = "M".

The Symptoms you get Code 800704B0 Error The specified device name is invalid - WSH VBScript

The script does not execute as you hoped, instead you get a WSH error message.  The probable scenario is that you are trying to create a Windows logon script.

The Cause of Error 800704B0

The problem is that you made a mistake with the drive letter.  It is not plain "M", it should have a colon and so be "M:"  Note that Source: WSHNetwork.MapNetworkDrive gives a valuable clue.  WSH has indicated Line 10, which narrow down the search.  Char 1 is not very helpful in this case.  What happens if there is an error on the line, sometimes Char 1 gets blamed.

Solutions for The specified device name is invalid

Edit Line 10

WShNetwork.MapNetworkDrive "M", RemotePath

Change the "M" to "M:"

WShNetwork.MapNetworkDrive "M:", RemotePath

Check this section for examples of MapNetworkDrive

Example 1 of Script 800704B0

 

Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set AllDrives = WshNetwork.EnumNetworkDrives()

DriveLetter = "M:"
RemotePath = "\\alan\home"
strRemoteName = "Guy"

WShNetwork.MapNetworkDrive "M", RemotePath

WshShell.PopUp "Drive " & DriveLetter & " connected successfully."

 

Example 2 of Script 800704B0

objNetwork.addPrinterConnection "HP 4L", "\\Lucy4\HP Laser 4L"

Too many arguments, and also wrong method.

What it should be is :

objNetwork.addWindowsPrinterConnection  "\\Lucy4\HP Laser 4L"
Also note there is only one argument, the name of the shared printer.

 

' HPPrinter.vbs
' Script to map an HP Printer from the Lucy4 server
' Version 1.1 August 2004
' Guy Thomas http://computerperformance.co.uk

Option Explicit
Dim objNetwork

Set ObjNetwork = CreateObject("Wscript.Network")
objNetwork.addPrinterConnection "HP 4L", "\\Lucy4\HP Laser 4L"
Wscript.echo " Share Mapped "
Wscript.Quit

' End of Guy's script

 


Computer Training Software - Recommended Training VideosGuy Thomas recommends Computer Training Software.  Their topics and material are ideal for getting you started with VBScript.  The videos are easy to follow and you can control the pace.  Try their free demo material and then see if you want to buy the full package. See more about VB Script Training CD.


Do you have a good example of this error?  If so, then email me I will publish it with a credit to you:

Do you need extra help?

For interpreting the WSH messages check Diagnose 800 errors.

For general advice try my 7 Troubleshooting techniques

 


Download my Logon Script eBook for only $6.25

Logon ScriptThe extra features you get in your eBook include, more pages full of detailed examples.  Also, ten 'how to...' sections, with screen shots showing which menus to use.  Go for Guy's eBook - and get a printable version with copy enabled and no expiry date.

  Jumbo Script 7 Package

 *


Google

WebComputerperformance.co.uk

GFi Events Manager

Guy Recommends: GFi EventsManager

Here is a solution to monitor, manage and archive thousands of events that are generated by devices across your entire network.  Get your free evaluation copy of GFI EventsManager.

 

Home Copyright © 1999-2008 Computer Performance LTD All rights reserved

Please report a broken link, or an error.