M
mrmwalter
Hi,
I have a simple form. On it is a Text Box that asks for "Username to
be entered". It also has a Radio Button that asks if the user needs to
be added to the local admin account.
I have an external vbs that adds user to local admin account, but how
do I pass the vbs the "UserName" that is entered on the form, if also
admin radio button is selected?
To launch the vbs, on the form, I will be using:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim p As Process
p = Process.Start("C:\VB\Test\BasicUsername.vbs")
p.WaitForExit()
End Sub
The vbs I use (BasicUsername.vbs) to add username to local admin
account is:
strComputer = "project"
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators")
Set objUser = GetObject("WinNT://offline/abc")
objGroup.Add(objUser.ADsPath)
msgbox "done."
where username is manually set to "abc".
So what I am looking for is a way to replace the "abc" with the
username that was added on the form. As the vbs is an external file -
is it possible?
Hope you can help!
Many thanks.
I have a simple form. On it is a Text Box that asks for "Username to
be entered". It also has a Radio Button that asks if the user needs to
be added to the local admin account.
I have an external vbs that adds user to local admin account, but how
do I pass the vbs the "UserName" that is entered on the form, if also
admin radio button is selected?
To launch the vbs, on the form, I will be using:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim p As Process
p = Process.Start("C:\VB\Test\BasicUsername.vbs")
p.WaitForExit()
End Sub
The vbs I use (BasicUsername.vbs) to add username to local admin
account is:
strComputer = "project"
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators")
Set objUser = GetObject("WinNT://offline/abc")
objGroup.Add(objUser.ADsPath)
msgbox "done."
where username is manually set to "abc".
So what I am looking for is a way to replace the "abc" with the
username that was added on the form. As the vbs is an external file -
is it possible?
Hope you can help!
Many thanks.