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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you break down a username?

Status
Not open for further replies.

Stephon98caffe

Programmer
Feb 18, 2005
25
US
I need to write a script for my boss that will take a username ie vacosmiths1. And remove the vaco from the username and leave me with smiths1.
 
Not sure what you mean by 'take the username'...

Brian

Code:
Set oNetwork = CreateObject("WScript.NetWork") 
cUser = LCase(oNetwork.UserName)

If left(cUser,4)="vaco" Then 
  nLen = 4
Else
  nLen = 0
End If 

WScript.Echo Right(cUser, Len(cUser)-nLen)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top