Mapping Drives

  • Thread starter Thread starter Anthony
  • Start date Start date
A

Anthony

How do I create a small .vbs file that includes the
correct syntax of the net use command to map several
shares to drive letters (Win2K Pro)?

For example, I've tried [net use f: \\win2kSrv\downloads]
AND [net use f: \\192.96.48.1\downloads] in a .vbs file
without success. I keep getting an error: end of
statement expected at character 9. When I type it at the
command prompt it works fine. Drive letter f: is not
currently mapped.

The text in my .vbs file is as follows:

net use f: /d
net use f: \\win2ksrv\downloads
net use g: /d
net use g: \\win2ksrv\utilities
net use h: /d
net use h: \\win2ksrv\AAHomeDir

Any suggestions?
 
those are batch commands not vbs scripts. You can use below in vbs:

Dim oNet
Set oNet = CreateObject ("Wscript.Network")
oNet.MapNetworkDrive "Q:", "\\mail\wwwroot"
 
Back
Top