Login Script in Using in Active Directory Environments
Tested by me
filename:logon.vbs
strComputer = "."
strDrive = "X:"
strLabel = "Disk On Server"
strPath = "\\server\E$\Report"
strUser = ""
strPassword = ""
boolPersistent = True
strNewName = "Disk On Server"
set objNetwork = WScript.CreateObject("WScript.Network")
objNetwork.MapNetworkDrive strDrive, strPath, boolPersistent
Set objShell = CreateObject("Shell.Application")
objShell.NameSpace(strDrive).Self.Name = strNewName
Wscript.Echo "Login OK"
WScript.Quit
extention:
check exist disk?
Yes: no create
No: new create
after changing volume disk
filename:logon.vbs
strComputer = "."
strDrive = "X:"
strLabel = "Disk On Server"
strPath = "\\server\E$\Report"
strUser = ""
strPassword = ""
boolPersistent = True
strNewName = "Disk On Server"
set objNetwork = WScript.CreateObject("WScript.Network")
objNetwork.MapNetworkDrive strDrive, strPath, boolPersistent
Set objShell = CreateObject("Shell.Application")
objShell.NameSpace(strDrive).Self.Name = strNewName
Wscript.Echo "Login OK"
WScript.Quit
extention:
check exist disk?
Yes: no create
No: new create
after changing volume disk
Nhận xét
Đăng nhận xét