Map a network driveThis is a featured page


function test_ole_mapdrive(pDrive, pShare, pUsername, pPassword)
/*


Parameters:
drive (in) required = single letter
share (in) required = unc sharename, e.g. \\myserver\myshare
username (in) optional = alternate username. Leave blank to authenticate as current windows user
password (in) optional = password for alternate username. Leave blank to authenticate as current windows user

return value:
0 for success
non-zero error number for failure


*01-31-08 rjc Created

*/


drive = if assigned(pdrive) then pDrive else ''
drive = drive[1,1]:':'
Share = if assigned(pShare) then pShare else ''
Username = if assigned(pUsername) then pUsername else ''
Password = if assigned(pPassword) then pPassword else ''
err = ''

bUpdateProfile = 0

if drive and share then
oNetwork = OleCreateInstance('Wscript.Network')
x = oNetWork->MapNetworkDrive( drive,share, bUpdateProfile, username, password)
err = OleStatus()
end else
err = -1
end

return err


rcarten
rcarten
Latest page update: made by rcarten , Jan 31 2008, 11:51 AM EST (about this update About This Update rcarten Created - rcarten

132 words added

view changes

- complete history)
Keyword tags: ole wscript.network
More Info: links to this page
There are no threads for this page.  Be the first to start a new thread.