gunsmokingman, on Oct 7 2006, 03:28 PM, said:
Quote
Dim Act : Set Act = CreateObject("Wscript.shell")
Dim StrUser : StrUser = Act.ExpandEnvironmentStrings("%UserName%")
Dim StrPass
StrPass = InputBox("Type in the password","Password")
If StrPass <> "" Then
MsgBox "User Type In : " & StrPass & vbCrLf &_
"User Name : " & StrUser, 0 + 32 + 4096, "Password"
Else
MsgBox "Nothing was type in preparing to quit", 0 + 32 + 4096, "No Text Detected"
End If
Thanks, but that is not what i need. I guess i wasn't specific enough. Please Let me explain everyting:
I used the file Yzowl and GSM put together and tweaked it. Then i made this file:
Quote
TITLE User Account Creation
ECHO Create Desired amount of User Accounts with a
ECHO set Username and Password that Never Expires.
:USER
ECHO.
ECHO.
ECHO Type in Username and Password for Account
ECHO Note: Case-Sensitive
ECHO.
SET /P USERNAME=Username:
SET /P PASS=Password:
ECHO.
ECHO Your input was...
ECHO Username: %USERNAME%
ECHO Password: %PASS%
ECHO Type in YES to Change it or NO to Confirm.
:CHANGE
SET /P CHANGE=Change:
IF /I "%CHANGE%"=="YES" goto :USER
IF /I "%CHANGE%"=="Y" goto :USER
IF /I "%CHANGE%"=="NO" goto :GROUP
IF /I "%CHANGE%"=="N" goto :GROUP
ECHO Error! Please Try again (Yes/No)...
goto :CHANGE
:GROUP
ECHO.
ECHO Please Specify account User Privelages...
ECHO Note that:
ECHO 1 = Administrators
ECHO 2 = Users
ECHO 3 = Guests
SET /P GROUP=Group:
IF /I "%GROUP%"=="1" SET GROUP=Administrators
IF /I "%GROUP%"=="2" SET GROUP=Users
IF /I "%GROUP%"=="3" SET GROUP=Guests
goto :FINALISE
:FINALISE
cls
ECHO.
ECHO The Account you will create has the
ECHO following attributes:
ECHO.
ECHO Username: %USERNAME%
ECHO Password: %PASS%
ECHO Group: %GROUP%
ECHO.
:CHANGE1
ECHO Type in YES to Change it or NO to Confirm.
SET /P CHANGE1=Change:
IF /I "%CHANGE1%"=="YES" goto :USER
IF /I "%CHANGE1%"=="Y" goto :USER
IF /I "%CHANGE1%"=="NO" goto :CREATION
IF /I "%CHANGE1%"=="N" goto :CREATION
ECHO Error! Please Try again (Yes/No)...
goto :CHANGE1
:CREATION
ECHO.
ECHO Creating %USERNAME%'s Account...
net user %USERNAME% %PASS% /add
net localgroup %GROUP% %USERNAME% /add
net accounts /maxpwage:unlimited
cls
ECHO Task Completed Successfully
goto :CHOICE
:CHOICE
cls
ECHO Do you want to Create any more User Accounts?
ECHO Type in YES to create more or NO to Exit
SET /P CREATION=Change:
IF /I "%CREATION%"=="YES" goto :USER
IF /I "%CREATION%"=="Y" goto :USER
IF /I "%CREATION%"=="NO" goto :END
IF /I "%CREATION%"=="N" goto :END
:END
ECHO.
SET /P END=Press Enter to Exit...
exit
I then decided I wanted it in the same style as the HTA.
So i modded it like this:
Quote
HTA EDIT BY GUNSMOKINGMAN
HTA RE-EDIT BY BETA4ME -->
<HTML><HEAD>
<TITLE>User Account Creation</TITLE>
<HTA:APPLICATION
applicationname="User Account Creation"
maximizebutton="no"
minimizebutton="yes"
scroll="no"
showintaskbar="yes"
singleinstance="yes"
Icon="%SystemRoot%\explorer.exe">
<STYLE type="text/css">
Body
{
font:10.75pt;
font-family: arial, Verdana, Palatino Linotype;
color:#E3E3E3;
filter:progid:DXImageTransform.Microsoft.Gradient
(GradientType=0, StartColorStr='#00CC00', EndColorStr='#4E4E4E');
padding-top:1;
padding-bottom:1;
Text-Align:;
}
.Button
{
font: 8.25pt;
font-family: Verdana, Palatino Linotype;
color:#E1E1E1;
font-weight:bold;
Text-Align:Center;
filter:progid:DXImageTransform.Microsoft.Gradient
(GradientType=0,StartColorStr='#d0d0d0',endColorStr='#008C80');
padding-top:1;
padding-bottom:1;
cursor:Hand;
Height:19; width:93;
border-left: 1px Transparent;
border-right: 2px Transparent;
border-top: 1px Transparent;
border-Bottom: 2px Transparent;
}
.TextBackGround
{
font-family: arial, Verdana, Palatino Linotype;
color:#1E1E1E;
font-weight:bold;
filter:progid:DXImageTransform.Microsoft.Gradient (GradientType=0,StartColorStr=#e2ded8,EndColorStr=#e8e2de;
padding-top:1; padding-bottom:1;
border-left: 3px none Transparent;
border-right: 2px none Transparent;
border-top: 3px none Transparent;
border-Bottom: 2px none Transparent;; font-style:normal; font-variant:normal; font-size:8.25pt
}
</STYLE>
<script Language="JavaScript">
var Act = new ActiveXObject("Wscript.Shell");
var Fso = new ActiveXObject("Scripting.FileSystemObject");
/* CLOSE THE HTA -> */
function ExitThis() { window.close();}
/* RUN BUTTON CHANGE TEXT -> */
function Button1ChangeText() { if (Run_Button.value =="Submit Data")
{Run_Button.value ='Press To Add'
Txt1.innerHTML= 'All Three Text Boxes Must Be Filled In. <BR>If Any ' +
'Text Box Is Not Filled In It Will Not <BR>Run The Script!' }
else {Run_Button.value ='Submit Data', Txt1.innerHTML= '';}}
/* CLEAR BUTTON CHANGE TEXT -> */
function Button2ChangeText() { if (Clear_Button.value =="Clear Text")
{Clear_Button.value ='Clear Text'} else {Clear_Button.value ='Clear Text';}}
/* CLOSE BUTTON CHANGE TEXT -> */
function Button3ChangeText() { if (Close_Button.value =="Close App")
{Close_Button.value ='Close App'} else {Close_Button.value ='Close App';}}
</SCRIPT>
<script language="VBScript">
Dim strPass, strName, strGroup
'/-> TEXT BOXES SCRIPTS
Function RegEdit()
strName = TextBox0.Value : strPass = TextBox1.Value : strGroup = TextBox2.Value
If strName = "" Then
window.alert "Alert" & vbcrlf & "You need to fill in " & chr(34) & "Username" & chr(34)
document.getElementByID("textbox0").select
ElseIf strPass = "" Then
window.alert "Alert" & vbcrlf & "You need to fill in " & chr(34) & "Password" & chr(34),64,"Alert"
document.getElementByID("textbox1").select
ElseIf strGroup = "" Then
window.alert "Alert" & vbcrlf & "You need to fill in " & chr(34) & "Group" & chr(34),64,"Alert"
document.getElementByID("textbox2").select
'/-> START SCRIPT
Else
Set strScript = Fso.CreateTextFile("CreateUser.vbs")
strScript.WriteLine "Set Act = CreateObject(" & chr(34) & "WScript.Shell" & chr(34) & ")"
strScript.WriteLine "Set Fso = CreateObject(" & chr(34) & "Scripting.FileSystemObject" & chr(34) & ")"
'/-> BODY of SCRIPT
strScript.WriteLine "Fso.DeleteFile(WScript.ScriptFullName)"
strScript.Close
call RunScript
End If
End Function
'/-> FINISH SCRIPT
'/-> RUN NEW SCRIPT AND THEN DELETE THE SCRIPT
Function RunScript() : Act.Run("CreateUser.vbs"), 1, True : End Function
'/-> CLEAR THE TEXT BOXES
Function ClearText() : TextBox0.Value = "" : TextBox1.Value = "" : TextBox2.Value = "" : End Function
'/-> ON LOAD EVENT
Function window_Onload() : window.ResizeTo 440,260 : TextBox0.focus() : End Function
</SCRIPT>
</HEAD><BODY><CENTER>
<!-- TEXT BOX TABLE START --><TABLE width='90%' border='1' cellpadding='6'><TD>
<!-- TEXT BOX 01 START -->
<TABLE><TD Width='125'><B>» Username</TD><TD> :</B></TD>
<TD colspan="2"><Input type="text" Class='TextBackGround' size="36" name="textbox0">
</TD></TABLE>
<!-- TEXT BOX 02 START -->
<TABLE><TD Width='125'><B>» Password</TD><TD> :</B></TD>
<TD colspan="2"><Input type="text" Class='TextBackGround' size="36" name="textbox1">
</TD></TABLE>
<!-- TEXT BOX 03 START -->
<TABLE><TD Width='125'><B>» Group</TD><TD> :</B></TD>
<TD colspan="2"><Input type="text" Class='TextBackGround' size="36" name="textbox2"></TD>
</TABLE></TD>
<!-- TEXT BOX TABLE END --></TABLE>
<p style="margin-top: 0; margin-bottom: 0"> </p>
<!-- BUTTON TABLE START --><TABLE>
<!-- RUN BUTTON START -->
<TD Width='125' Align='Center'><Input type="button" Class='Button' Value="Submit Data" name="Run_Button"
OnMouseOver="Button1ChangeText(),this.style.color='#004f1a';"
OnMouseOut="Button1ChangeText(),this.style.color='#E1E1E1';"
onClick="RegEdit()"></TD>
<!-- CLEAR BUTTON START -->
<TD Width='125' Align='Center'><Input type="button" Class='Button' Value="Clear Text" name="Clear_Button"
OnMouseOver="Button2ChangeText(),this.style.color='#004f1a';"
OnMouseOut="Button2ChangeText(),this.style.color='#E1E1E1';"
onClick="ClearText()"></TD>
<!-- CLOSE BUTTON START -->
<TD Width='125' Align='Center'><Input type="button" Class='Button' Value="Close App" name="Close_Button"
OnMouseOver="Button3ChangeText(),this.style.color='#004f1a';"
OnMouseOut="Button3ChangeText(),this.style.color='#E1E1E1';"
onClick="ExitThis()"></TD>
<!-- BUTTON TABLE END --> </TABLE></CENTER>
<!-- Yzöwl TABLE START -->
<TABLE><TD WIDTH='236' HEIGHT='47' Style='font:8.75pt;Color:"#E1E1E1"'><SPAN ID='Txt1'></SPAN></TD>
<TD><FONT color="#E1E1E1" size="1.25">© 2006 Yzöwl. All Rights Reserved</FONT></TD></TABLE>
<!-- Yzöwl TABLE END -->
</BODY></HTML>
The section in Red, is another section of the Script i Edited (more like purged) and doesn't work. I need the CMD section that is in Red to be converted to VBS to put in (i think). Substituting %USERNAME% with strUser, %PASS% with strPass, and %GROUP% with strGroup.
Thanks peeps for all your help,
This post has been edited by mandrake10: 07 October 2006 - 07:30 PM



Help

Back to top











