/bundles/itninjaweb/img/Breadcrumb_cap_w.png
Hi,
I want to write one vbscript where I can check username contents. If username contains giona-admn then i should be able to trigger installation. I can read username but I am not able to put a code to check it's contents.

please guide.
0 Comments   [ - ] Hide Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity

Answers

0
How aboutIf LCase(strUsername) = "giona-admn" Then
'// Do stuff here
Else
'// Do something else here
End If
Answered 02/19/2010 by: VBScab
Red Belt

Please log in to comment
0
for example if my username starts with giona-admn then only i want to trigger installation. In below script, every time it aborts, even if my username starts from giona-admn. If I am giving full username hardcoded, like giona-admn-02563, then only it installs, same kind of problem I am facing while wise script as well.


Dim objNetwork
Set objNetwork = CreateObject("WScript.Network")
strUserName = objNetwork.UserName

MsgBox strUserName

If LCase(strUsername) = "giona-admn" Then
'// Do stuff here
msgbox "install"
Else
'// Do something else here
msgbox "abort"
End If
Answered 02/19/2010 by: abking99
Second Degree Blue Belt

Please log in to comment
0
Have you done any research into this? It's really not rocket science.

Look up the InStr and/or Left functions in the VBScript section on DevGuru.
Answered 02/19/2010 by: VBScab
Red Belt

Please log in to comment