Computing.Net > Forums > Networking > netuse and mapnetworkdrive

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

netuse and mapnetworkdrive

Reply to Message Icon

Original Message
Name: gravz84
Date: October 1, 2006 at 22:43:45 Pacific
Subject: netuse and mapnetworkdrive
OS: windows
CPU/Ram: x
Model/Manufacturer: 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


Report Offensive Message For Removal


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

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.


Report Offensive Follow Up For Removal

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

no reply there. plus its related to networks also!


Report Offensive Follow Up For Removal

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

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.


Report Offensive Follow Up For Removal

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

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!


Report Offensive Follow Up For Removal







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








Do you own an iPhone?

Yes
No, but soon
No


View Results

Poll Finishes In 7 Days.
Discuss in The Lounge
Poll History




Data Recovery Software