Network Logon Script

Discussion in 'HTML' started by Mikem, Apr 27, 2008.

  1. Mikem

    Mikem Guest

    <html>

    <head>
    <title>Central Login</title>
    </head>

    <body onload="resize()">
    <center>
    Please enter your login credentials below:
    <form name="loginform">
    Username: <input type="text" name="user"><br>
    Password: <input type="password" name="pass"><br><br>
    <input type="button" name="login" value="Login" onclick="auth()">
    </center>
    </body>

    <script language="vbscript">
    Sub resize
    window.resizeTo 400,197
    End Sub

    Function auth()
    dim user
    user = document.forms.loginform.user.value
    dim pass
    pass = document.forms.loginform.pass.value
    dim server
    server = "Central"
    dim server_unc
    server_unc = ("\\" & server)
    dim user_drive
    user_drive = "U:"
    dim users_folder
    users_folder = "Users"
    dim users_unc
    users_unc = (server_unc & "\" & users_folder)
    dim user_unc
    user_unc = (users_unc & "\" & user)
    dim docs_drive
    docs_drive = "Z:"
    dim docs_folder
    docs_folder = "Docs"
    dim docs_unc
    docs_unc = (server_unc & "\" & docs_folder)
    dim auth_command
    auth_command = ("net use " & server_unc & " " & "/user:" & user &
    " " & chr(34) & pass & chr(34))
    dim user_drive_command
    user_drive_command = ("net use " & user_drive & " " & user_unc &
    " /persistent:no")
    dim docs_drive_command
    docs_drive_command = ("net use " & docs_drive & " " & docs_unc &
    " /persistent:no")
    Set WshShell = CreateObject("WScript.Shell")
    WshShell.Run "cmd.exe /c " & auth_command
    WshShell.Run "cmd.exe /c " & user_drive_command
    WshShell.Run "cmd.exe /c " & docs_drive_command
    dim endmessage
    endmessage = ("Welcome, " & user & ". All login commands have
    been run.")
    msgbox endmessage
    window.close()
    End Function
    </script>

    </html>
    Mikem, Apr 27, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ezra
    Replies:
    1
    Views:
    617
    bruce barker
    Oct 11, 2004
  2. John

    LOGON without asp-script

    John, Aug 16, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    411
    Guest
    Aug 17, 2005
  3. Kjell Kristiansson
    Replies:
    0
    Views:
    282
    Kjell Kristiansson
    Nov 30, 2005
  4. Andrew

    Using jscript for logon script

    Andrew, Aug 5, 2003, in forum: Javascript
    Replies:
    2
    Views:
    135
    Michael Harris \(MVP\)
    Aug 8, 2003
  5. Alont
    Replies:
    13
    Views:
    203
    Alont
    Aug 18, 2004
Loading...

Share This Page