FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Msgbox Login Script.





Relentless
Hi,
I am writing a VBscript for a company server. My previous VB knowledge is (null).

I am using google to help me out lol.

This is my current script.

Hope you like it.

Code:
Set WSHNetwork = CreateObject("WScript.Network")

DomainString = WSHNetwork.UserDomain
UserString = WSHNetwork.UserName

Set UserObj = GetObject("WinNT://" & DomainString & "/" & UserString)

For Each GroupObj In UserObj.Groups
    Select Case GroupObj.Name

        Case "GROUP1"
            WSHNetwork.MapNetworkDrive "S:", "\\starsvr\S_DRIVE$"

        Case "GROUP2"
            WSHNetwork.MapNetworkDrive "T:", "\\starsvr\TENERIFE_DRIVE$"
       
        Case "GROUP3"
            WSHNetwork.MapNetworkDrive "K:", "\\starsvr\PRIVATE_DRIVE$"
       
        Case "EPOS"
            WSHNetwork.MapNetworkDrive "Z:", "\\starsvr\EPOS_DRIVE$"
       
        Case "GROUP4"
            WSHNetwork.MapNetworkDrive "U:", "\\starsvr\THE_BELL$"
       
        Case "FINANCE"
            WSHNetwork.MapNetworkDrive "F:", "\\starsvr\FINANCE_DRIVE$"
    End Select

Next

Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection "\\starsvr\RICOH Aficio CL7000"

mDrive = "S:\"
Set oShell = CreateObject("Shell.Application")
oShell.NameSpace(mDrive).Self.Name = "S DRIVE"

mDrive = "T:\"
oShell.NameSpace(mDrive).Self.Name = "TENERIFE DRIVE"

mDrive = "K:\"
oShell.NameSpace(mDrive).Self.Name = "Private Drive"

mDrive = "Y:\"
oShell.NameSpace(mDrive).Self.Name = "Your Personal Private Drive"

mDrive = "Z:\"
oShell.NameSpace(mDrive).Self.Name = "EPOS DRIVE"

mDrive = "U:\"
oShell.NameSpace(mDrive).Self.Name = "The Bell"

mDrive = "F:\"
oShell.NameSpace(mDrive).Self.Name = "Finance Drive"

msgbox "YOUR LOGON TO THE DOMAIN WAS:" & Vbcrlf & "" & Vbcrlf & "Successful     ^_^" & Vbcrlf & "" & Vbcrlf & " Have a nice day.",0,"LOGON"

WScript.Quit

*I have edited the code to hide some details.

The bit I want help with is the msgbox. The boss wanted something to say the logon on the computers was successful and I thought that pretty much does the job but everyone is complaining that they have to click "ok" (wow end of the world for some people)

Is there away to make this

Code:
msgbox "YOUR LOGON TO THE DOMAIN WAS:" & Vbcrlf & "" & Vbcrlf & "Successful     ^_^" & Vbcrlf & "" & Vbcrlf & " Have a nice day.",0,"LOGON"


With a 5 second time out and get ride of the ok button? that way they don't have to click ok... ?

Kind Regards
Daniel Kendall
Relentless
Ok I just tested my script and it does work so before any of you experts out there comment I have fixed my major error lol

If anyone wants to copy my script here is the version that works... no doubt an expert will reply with the answer to my problem and a neater way of doing my script. lol

Code:

Set WSHNetwork = CreateObject("WScript.Network")

DomainString = WSHNetwork.UserDomain
UserString = WSHNetwork.UserName

Set UserObj = GetObject("WinNT://" & DomainString & "/" & UserString)

For Each GroupObj In UserObj.Groups
    Select Case GroupObj.Name

        Case "STARS_UK"
            WSHNetwork.MapNetworkDrive "S:", "\\starsvr\STARS_DRIVE$"
        mDrive = "S:\"
        Set oShell = CreateObject("Shell.Application")
        oShell.NameSpace(mDrive).Self.Name = "STARS UK"
   
        Case "STARS_TENERIFE"
            WSHNetwork.MapNetworkDrive "T:", "\\starsvr\TENERIFE_DRIVE$"
        mDrive = "T:\"
        Set oShell = CreateObject("Shell.Application")
        oShell.NameSpace(mDrive).Self.Name = "STARS TENERIFE"
       
        Case "KENVYNS_DRIVE"
            WSHNetwork.MapNetworkDrive "K:", "\\starsvr\PRIVATE_DRIVE$"
        mDrive = "K:\"
        Set oShell = CreateObject("Shell.Application")
        oShell.NameSpace(mDrive).Self.Name = "The Kenvyn's Private Drive"
       
        Case "TOTAL_CONTROL"
            WSHNetwork.MapNetworkDrive "Z:", "\\starsvr\EPOS_DRIVE$"
        mDrive = "Z:\"
        Set oShell = CreateObject("Shell.Application")
        oShell.NameSpace(mDrive).Self.Name = "EPOS DRIVE"
       
        Case "THE_BELL_SM"
            WSHNetwork.MapNetworkDrive "U:", "\\starsvr\THE_BELL_SM$"
        mDrive = "U:\"
        Set oShell = CreateObject("Shell.Application")
        oShell.NameSpace(mDrive).Self.Name = "The Bell SM"
       
        Case "FINANCE"
            WSHNetwork.MapNetworkDrive "G:", "\\starsvr\FINANCE_DRIVE$"
        mDrive = "G:\"
        Set oShell = CreateObject("Shell.Application")
        oShell.NameSpace(mDrive).Self.Name = "Finance Drive"

    End Select

Next

Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection "\\starsvr\RICOH Aficio CL7000"

mDrive = "Y:\"
oShell.NameSpace(mDrive).Self.Name = "Your Personal Private Drive"

WScript.Quit

*I left the info on here... lol
Related topics
php login module
PHP login/logout problem
simple login script
Login Script
Login Script - PHP
150 frih$ if you make me a login script with....
Fix up a login script
Free PHP/MySQL login script
problem with login script
PHP login script problem
Free php script login / register , GREAT!
Servlet Basic login script?
Protect Your Page With Simple Login But Yet Powerful Script
Simple PHP Login Script
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.