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.
VBScript + Network + %username%
Name: DougBlane Date: April 19, 2004 at 06:56:17 Pacific OS: w2k CPU/Ram: n/a
Comment:
I use a VBScript log-on script to connect users to mapped network drives.
Option Explicit On Error Resume Next Dim oNetwork1 Set oNetwork1 = CreateObject("WScript.Network") oNetwork1.MapNetworkDrive "I:", "\\server\dir" oNetwork1 = nothing
I would like to connect individual users to individual drives, so I replaced \\server\dir with \\server\%username% however this doesn't work.
Summary: This is what i found and works. [!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"] [%@ Language=VBScript %] [% dim username dim userpage Username = Request.ServerVariables("LOG...
Summary: Whoops...sorry about the last code.... To actually get the username you have to use the network object. set network = createObject("wscript.network") username = network.username ...
Summary: It'll probably fail. If it does, feel free to use this function: const domain = "domain" Function GetUserADO() Set GetUserADO = Nothing Dim userName, con, com, rs, ret userName = CreateObject...