#1 25 Aug 2012 11:15

abis
Member
Registered: 25 Aug 2012
Posts: 3

Map network drive with hide path

Hi all,
i have that script vbs:

set objShell = CreateObject("Wscript.Shell")
Set objWSHNet = CreateObject("WScript.Network")

objWSHNet.MapNetworkDrive "V:", "\\localhost\d$"
if err.number=0 then
sDrive = "V:\"
Set oShell = CreateObject("Shell.Application")
oShell.NameSpace(sDrive).Self.Name = "Data"
end if

But i want to use to map from another station and that station have different credentials.
Anyone can tell me how to modify that script and use it with username and password?
Thank you all.

Last edited by abis (22 Nov 2012 15:32)

Offline

#2 01 Sep 2012 15:49

abis
Member
Registered: 25 Aug 2012
Posts: 3

Re: Map network drive with hide path

Ok, no one smile Then ill give myself the answer big_smile

set objShell = CreateObject("Wscript.Shell")
set objWSHNet = CreateObject("WScript.Network")

objWSHNet.MapNetworkDrive "V:", "\\server\share", False, "User", "Pa$$w0rd"
if err.number=0 then
sLocalDrive = "V:\"
set oShell = CreateObject("Shell.Application")
oShell.NameSpace(sLocalDrive).Self.Name = "Data"
end if

That one is with persistent disable, change False to True to be enable

Offline

Board footer

Powered by FluxBB