Computing.Net > Forums > Networking > netuse and mapnetworkdrive

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

netuse and mapnetworkdrive

Reply to Message Icon

Name: gravz84
Date: October 1, 2006 at 22:43:45 Pacific
OS: windows
CPU/Ram: x
Product: x
Comment:

Hi,
Could anyone please tell me how netuse(in windows) and mapnetworkdrive(using a script object) are different?
I wrote a script calling a batch file to map a shared folder to a drive letter and then perform some operation using that drive letter.
fso = CreateObject "Scripting.FileSystemObject")
fso.Copyfile(c:\xyz, "y:\xyz",true)

this somehow didn't work.
Then i tried mapping the drive inside the program:
nwobj = CreateObject("WScript.Network")
nwobj.MapNetworkDrive ("y:", "\xyz", False, Username, Password)

and then did the operation and it worked.
Could someone explain what the difference and the problem is here?

Thx



Sponsored Link
Ads by Google

Response Number 1
Name: wanderer
Date: October 2, 2006 at 09:47:29 Pacific
Reply:

try the "programming" forum to your left

Give a person a fish you feed them for a day.
Ask a person to internet search and they learn a skill for a lifetime.


0

Response Number 2
Name: gravz84 (by GRAVZ84)
Date: October 2, 2006 at 17:54:58 Pacific
Reply:

no reply there. plus its related to networks also!


0

Response Number 3
Name: dinkaragg
Date: October 3, 2006 at 05:22:59 Pacific
Reply:

net use z: /delete
net use z: \\computername\shared

This is all u need to create a batch file, where z is the Map Drive name and \\computername\shared is the path to the folder.

The first command is just to delete any existing drive with that name.


0

Response Number 4
Name: gravz84 (by GRAVZ84)
Date: October 4, 2006 at 20:46:20 Pacific
Reply:

lol..i know that..
but can u think of a reason why that drive letter can't be used inside a program like this..
fso = CreateObject "Scripting.FileSystemObject")
fso.Copyfile(c:\xyz, "z:\xyz",true)
(where z: is the mapped drive letter)
cos that's what doesn't work

but if i do mapping inside the program using wscript.network it works!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Networking Forum Home


Sponsored links

Ads by Google


Results for: netuse and mapnetworkdrive

Workgroup PCs and Net. Places Gone www.computing.net/answers/networking/workgroup-pcs-and-net-places-gone/33379.html

Workgroup PCs and Net. Places Gone www.computing.net/answers/networking/workgroup-pcs-and-net-places-gone/33382.html

HP and Dell www.computing.net/answers/networking/hp-and-dell/33435.html