Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display progress in VBS login script

Status
Not open for further replies.

fatboy69

Technical User
May 15, 2002
56
AU
Hi,

Newbie here, I need to display the progress of a login script running similar to the way a netware login script runs. I know this is probably basic, I have jsut taken over from the old IT admin and I am totally perplexed.

I have pasted in the script I am using. any advice or critique would be great.

ON ERROR RESUME NEXT

Set WSHShell = CreateObject("WScript.Shell")
Set WSHNetwork = CreateObject("WScript.Network")
Set fso = CreateObject("Scripting.FileSystemObject")
DomainString = "site.com.au"
UserString = WSHNetwork.UserName
HomeDriveLetterString = "H:"
HomePathString = "\\SERVER01\USERS"

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

'Maps Network drives needed by all
WSHNetwork.MapNetworkDrive "W:", "\\SERVER01\DATA\CORPORATE",False
WSHNetwork.MapNetworkDrive "F:", "\\SERVER01\PROGRAMS",False


'Map Users Home Drive
Dim HomeDriveLetterString, HomePathString, UserString
WSHNetwork.MapNetworkDrive HomeDriveLetterString, HomePathString & "\" & UserString

'Check for group memberships and map appropriate drives
For Each GroupObj In UserObj.Groups

Select Case GroupObj.Name
'Check for group memberships and take needed action
Case "GP-TRANSACCESS"
WSHNetwork.MapNetworkDrive "Q:", "\\SERVER01\DATA\TRANSACCESS\DATA",False
Case "GP-COMP1"
WSHNetwork.MapNetworkDrive "Q:", "\\SERVER01\DATA\COMP1\DATA",False
Case "GP-TRAINING"
WSHNetwork.MapNetworkDrive "N:", "\\SERVER01\DATA\TRAINING\DATA",False
Case "GP-SUPERVISORS"
WSHNetwork.MapNetworkDrive "S:", "\\SERVER01\DATA\SUPERVISORS\DATA",False
Case "GP-OPERATIONS"
WSHNetwork.MapNetworkDrive "U:", "\\SERVER01\DATA\OPERATIONS\DATA",False
Case "GP-MARKET"
WSHNetwork.MapNetworkDrive "K:", "\\SERVER01\DATA\MARKET\DATA",False
Case "GP-MEMREL"
WSHNetwork.MapNetworkDrive "G:", "\\SERVER01\DATA\MEMREL\DATA",False
Case "GP-BIZSUPPORT"
WSHNetwork.MapNetworkDrive "I:", "\\SERVER01\DATA\BIZSUPPORT\DATA",False
Case "GP-INVESTIGATIONS"
WSHNetwork.MapNetworkDrive "R:", "\\SERVER01\DATA\INVESTIGATIONS\DATA",False
Case "GP-LOS"
WSHNetwork.MapNetworkDrive "R:", "\\SERVER01\DATA\LOS\DATA",False
Case "GP-USMC"
WSHNetwork.MapNetworkDrive "O:", "\\SERVER01\DATA\USMC\DATA",False
Case "GP-EXECUTIVE"
WSHNetwork.MapNetworkDrive "P:", "\\SERVER01\DATA\EXECUTIVE\DATA",False
Case "GP-HR"
WSHNetwork.MapNetworkDrive "Q:", "\\SERVER01\DATA\HR\DATA",False
Case "GP-FINANCE"
WSHNetwork.MapNetworkDrive "K:", "\\SERVER01\DATA\FINANCE\DATA",False
Case "GP-CREDCON"
WSHNetwork.MapNetworkDrive "L:", "\\SERVER01\DATA\CREDCON\DATA",False
Case "GP-CALLCENTER"
WSHNetwork.MapNetworkDrive "N:", "\\SERVER01\DATA\CALLCENTER\DATA",False
Case "GP-AUDIT"
WSHNetwork.MapNetworkDrive "T:", "\\SERVER01\DATA\AUDIT\DATA",False
Case "GP-ACCESS"
WSHNetwork.MapNetworkDrive "O:", "\\SERVER01\DATA\ACCESS\DATA",False
Case "GP-HBADMIN"
WSHNetwork.MapNetworkDrive "G:", "\\SERVER01\DATA\HBADMIN\DATA",False
Case "GP-INTRANET"
WSHNetwork.MapNetworkDrive "I:", "\\SERVER01\DATA\INTRANET\DATA",False
Case "GP-INSET"
WSHNetwork.MapNetworkDrive "M:", "\\SERVER01\DATA\INSET\DATA",False
Case "GP-IT"
WSHNetwork.MapNetworkDrive "T:", "\\SERVER01\DATA\IT\DATA",False
Case "GP-MAXSELL"
WSHNetwork.MapNetworkDrive "L:", "\\SERVER01\DATA\FINANCE\DATA\Max$ell",False
Case "GP-DIRECTORS"
WSHNetwork.MapNetworkDrive "J:", "\\SERVER01\DATA\DIRECTORS\DATA",False
Case "GP-ORIGIN-TRAIN"
WSHNetwork.MapNetworkDrive "Q:", "\\SERVER01\DATA\ORIGIN-TRAIN\DATA",False
Case "GP-PROJECT"
WSHNetwork.MapNetworkDrive "V:", "\\SERVER01\DATA\PROJECT\DATA",False

End Select

Next

'Launch Intranet Batch file from W: Drive

Dim WSHShell
WSHShell.Run ("W:\Intranet.bat")

'Clean Up Memory Used
set UserObj = Nothing
set GroupObj = Nothing
set WSHNetwork = Nothing
set DomainString = Nothing
set WSHSHell = Nothing
set fso = Nothing

wscript.quit
 
Why do you call intranet.bat? Why not include its contents into this script and prevent the need to launch a separate VM?

I posted a progress bar in this thread that has been fairly popular.
I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Hi Mark, thnkyou for your reply.

I am not really after a progress bar as such, just a window that pops up, displays each drive being mapped etc etc, and then closes when complete- the exact same way a netware script works.

Also, the intranet.bat file is for desktop environment confnigurations, we are slowly implementing SMS to handle this, but as many people would know- legacy is hard to remove.....

Cheers FB.
 
Force your script to execute under CScript instead of Wscript. Then use Wscript.Echo to write out what you want the user to see. Not sure why you want to emulate Netware. Seems it would only slow things down.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Thanks Mark, the emulation of netware is purley astetic as these are very precious users and going from a script that displays progress to a hidden process will freak to many people out and our help desk cant handle it.

Cheers Again.
 
ok speaking as a netware guy

do you think the users pay attention to the script running
personally i only like to see the sript running to see if there were 8804's

ms isnt going to show these errors so i dont really see the point

to me users just want to turn on and see a desktop they dont want to know what it is doing - they only think of the mappings when they use thyem

and even in netware a properly configured system the message would fly past that quick no-one would be able to read it





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top