PDA

View Full Version : Cannot map a network drive



NewsArchive
07-31-2009, 03:33 AM
Hi,

Below script assign a driveletter to a variable and tries to create a
network connection but fails.

Set Variable %TESTDREV% to "V:\"
If %TESTDREV% File or Folder doesn't exist Then
Set Variable %MAPDREV% to "V:"
End
Map Network Drive %SERVERNAME%\%SHARE% to "%MAPDREV%"
If %_SB_ERRORCODE% Greater Than "0" Then
! ERROR - must use full UNC-path
Set Variable %_SB_INSTALLDIR% to
"\\%SERVERNAME%\%SHARE%\Progs\MariSoft\Mamut"
ElseIf %_SB_ERRORCODE% Equals "0" Then
!Maps OK
Set Variable %_SB_INSTALLDIR% to "%MAPDREV%\Progs\MariSoft\Mamut"
End

What could be wrong here ?

Cheers,
/Poul

NewsArchive
07-31-2009, 03:33 AM
Poul,

If the function fails, %_SB_ERRORCODE% gives you an error code. You can
then check the following link to find out what went wrong:

http://msdn.microsoft.com/en-us/library/ms681381(VS.85).aspx

See attached screenshot. This code works fine.

Hope this helps.

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder is Windows installation -- "point. click. ship"

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
07-31-2009, 03:34 AM
Hi Friedrich,

> Poul,
>
> If the function fails, %_SB_ERRORCODE% gives you an error code. You can
> then check the following link to find out what went wrong:
>
> http://msdn.microsoft.com/en-us/library/ms681381(VS.85).aspx
>
> See attached screenshot. This code works fine.
>

It returns error 66 - The network resource type is not correct

Whatever that means ?

/Poul

NewsArchive
07-31-2009, 03:34 AM
>
> It returns error 66 - The network resource type is not correct
>
> Whatever that means ?
>

That means your Remote Name is incorrect. For example, Remote Name is
\\Vista64-pc\lindersoft here and maps the network drive. If I change this
to, say, \\Win98-pc\lindersoft (which does not exist) then Windows will
return ERROR_BAD_DEV_TYPE = error 66.

Hope this helps.

Friedrich

NewsArchive
07-31-2009, 03:35 AM
>
> It returns error 66 - The network resource type is not correct
>
> Whatever that means ?

By the way, you have this:

Map Network Drive %SERVERNAME%\%SHARE% to "%MAPDREV%"

Not sure what the value of %SERVERNAME% is in your case. But if the value
does not have a leading "\\" then Windows will give you error 66.

If the %SERVERNAME% value does not have the leading "\\" then I would
suggest to change it to:

Map Network Drive \\%SERVERNAME%\%SHARE% to "%MAPDREV%"

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder is installation -- "point. click. ship"

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
07-31-2009, 03:35 AM
Hi,

> >
>> It returns error 66 - The network resource type is not correct
>>
>> Whatever that means ?
>
> By the way, you have this:
>
> Map Network Drive %SERVERNAME%\%SHARE% to "%MAPDREV%"
>
> Not sure what the value of %SERVERNAME% is in your case. But if the value
> does not have a leading "\\" then Windows will give you error 66.
>
> If the %SERVERNAME% value does not have the leading "\\" then I would
> suggest to change it to:
>
> Map Network Drive \\%SERVERNAME%\%SHARE% to "%MAPDREV%"

The variables at set by this function:
Set Variable %SERVERNAME% to FUNCTION:Extract Server
Name(%MBS_DATAPATH%)
Set Variable %SHARE% to FUNCTION:Extract Share
Name(%MBS_DATAPATH%)

And are correctly formatted.

I will check as per your previous message.

Thanks.
/Poul

NewsArchive
07-31-2009, 03:42 AM
> The variables at set by this function:
> Set Variable %SERVERNAME% to FUNCTION:Extract Server
> Name(%MBS_DATAPATH%)
> Set Variable %SHARE% to FUNCTION:Extract Share
> Name(%MBS_DATAPATH%)
>
> And are correctly formatted.
>
> I will check as per your previous message.

If you are using the above functions then your "Remote Name" is not correct!

Change it to the following and you are done:

Map Network Drive \\%SERVERNAME%\%SHARE% to "%MAPDREV%"

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder is installation -- "point. click. ship"

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
08-01-2009, 02:00 AM
DUH !

You are so correct.

Thanks
/Poul