Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Win2000 and mapping a drive problem
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00613353
Message ID:
00613571
Vues:
8
>>>When the following code gets run on Win2000 a new window pops up showing the newly mapped drive. How can we supress this window? We don't have this problem on NT or Win9X OSs. We would rather the users not be confused with this new window.
>>>
>>>
>>>function NetConnect
>>>LPARAMETERS Lc_DRIVE, Lc_SERVER, Lc_USER, Lc_PASSWORD
>>>
>>>*First attempt to connect via WSH
>>>nlerror=.f.
>>>ON ERROR nlerror=.t.
>>>oNet = CREATEOBJECT('WScript.Network')
>>>IF NOT nlerror	&&WSH available!
>>>   oNet.MapNetworkDrive(Lc_DRIVE, Lc_SERVER,, Lc_USER, Lc_PASSWORD)
>>>   IF NOT nlerror	&&Map ok!
>>>      ON error
>>>      RELEASE oNet
>>>      RETURN .T.
>>>   endif
>>>ENDIF
>>>ON ERROR
>>>
>>>
>>>TIA

Download my NETRESOURCE class and use the sample code to implement WNetAddConnection3()
>>
>>Jeff,
>>
>>I've been asked the same question in connection with simply mapping a drive through the explorer. I can't find anyway to suppress this behavior, so I'm interrested if there's an answer as well. I will try to dig around the WSH docs, however, to see if there's something I can find that can help.
>
>I was hoping that by putting this in the API section you and Ed would jump in and cure my ills. I've looked for something in the WSH and found nothing maybe you can do better. This is a real pain that I really want to get rid of.
>
>Jeff
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform