/build/static/layout/Breadcrumb_cap_w.png

Check username contents

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   [ + ] Show comments

Answers (3)

Posted by: anonymous_9363 14 years ago
Red Belt
0
How aboutIf LCase(strUsername) = "giona-admn" Then
'// Do stuff here
Else
'// Do something else here
End If
Posted by: abking99 14 years ago
Second Degree Blue Belt
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
Posted by: anonymous_9363 14 years ago
Red Belt
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.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ