Beta4Me Posted October 3, 2006 Share Posted October 3, 2006 The Topic title pretty much covers it but this is my problem:I've seen this in Several CMD's but cannot understand how to do it.I want to Ask a User to input something. Then that something becomes a variable (I think that's the word), i.e. Set Name=Something; (With Something being the User's Input).I need to edit Reg settings after the Setup. But I want my Windows Setup to be a base setup that is customized in some parts by the user after the Setup, so it can be flexible.Please Help me, , Your my only hope. Thanks in advance.[offtopic]I hope this is in the right section.[/offtopic] Link to comment Share on other sites More sharing options...
Br4tt3 Posted October 3, 2006 Share Posted October 3, 2006 I can only encourage u to run it from a .vbs script instead.. easier, better and more efficient IMHO, example:Option ExplicitDim Input, Command, WshShellSet WshShell = WScript.CreateObject("WScript.Shell")Input = InputBox("Application .exe name to run")MsgBox ("You entered: " & Input)'Exec the application of choice or whatever...ExecApp(Input)'******************'* Execute Function'******************Function ExecApp(pstrCommand) Command = WshShell.Run(pstrCommand, 0, True)End FunctionTry for example: calc.exe and it will be launched.. u can then replace that with reg load or something else... Link to comment Share on other sites More sharing options...
Ctrl-X Posted October 3, 2006 Share Posted October 3, 2006 To assign user input to an environment variable, use SET /P. For example:SET /P INPUT=Type some input:ECHO Your input was: %INPUT%Type SET /? in a command prompt window for details. Link to comment Share on other sites More sharing options...
mazin Posted October 3, 2006 Share Posted October 3, 2006 To assign user input to an environment variable, use SET /P. For example:SET /P INPUT=Type some input:ECHO Your input was: %INPUT%Type SET /? in a command prompt window for details.Yes, that easy. And the %INPUT% variable (as given by Ctrl-X) is valid during the session of your batch filewhere you used SET.In the same batch file, you can SET other variable like INPUT1, INPUT2, and so on. Link to comment Share on other sites More sharing options...
Beta4Me Posted October 3, 2006 Author Share Posted October 3, 2006 Thanks guys for your Help. Now I can have my Variables and Reg as i Like, . Link to comment Share on other sites More sharing options...
Beta4Me Posted October 4, 2006 Author Share Posted October 4, 2006 (edited) Sorry to ask another Question but; Where in the registry are:1 - Computer Name (As in the one in My Computer -> Properties -> Computer Name (Tab) -> Full Computer Name: ______)2 - User Name (As in the one in My Computer -> Properties ->Registered to: ________) [e.g. Bob Jones]3 - Company Name (As in the one in My Computer -> Properties ->Registered to: ________) [e.g. Bob Jones P/L]Thanks in advance.EDIT: My Current Files are as follows:COMPUTERNAME.cmd@echo offTITLE=Post Windows Setup CustomizationSET KEY=???ECHO Type in the Name of thisECHO Computer and then press Enter:COMPUTERNAMEECHO.SET /P COMPUTERNAME=Computer Name:ECHO Your input was: %COMPUTERNAME%ECHO Type in YES to Change it or NO to Confirm.:CHANGESET /P CHANGE=Change:IF "%CHANGE%"=="YES" goto :COMPUTERNAMEIF "%CHANGE%"=="yes" goto :COMPUTERNAMEIF "%CHANGE%"=="Yes" goto :COMPUTERNAMEIF "%CHANGE%"=="yEs" goto :COMPUTERNAMEIF "%CHANGE%"=="yeS" goto :COMPUTERNAMEIF "%CHANGE%"=="YeS" goto :COMPUTERNAMEIF "%CHANGE%"=="YEs" goto :COMPUTERNAMEIF "%CHANGE%"=="NO" goto :REGISTRYIF "%CHANGE%"=="no" goto :REGISTRYIF "%CHANGE%"=="nO" goto :REGISTRYIF "%CHANGE%"=="No" goto :REGISTRYECHO Error! Please Try again...goto :CHANGE:REGISTRYREG ADD %KEY%goto :END:ENDECHO.SET /P END=Press Enter to Exit...exitUSERNAME.cmd@echo offTITLE=Post Windows Setup CustomizationSET KEY=???ECHO Type in your NameECHO and then press Enter:NAMEECHO.SET /P NAME=Name:ECHO Your input was: %NAME%ECHO Type in YES to Change it or NO to Confirm.:CHANGESET /P CHANGE=Change:IF "%CHANGE%"=="YES" goto :NAMEIF "%CHANGE%"=="yes" goto :NAMEIF "%CHANGE%"=="Yes" goto :NAMEIF "%CHANGE%"=="yEs" goto :NAMEIF "%CHANGE%"=="yeS" goto :NAMEIF "%CHANGE%"=="YeS" goto :NAMEIF "%CHANGE%"=="YEs" goto :NAMEIF "%CHANGE%"=="Y" goto :NAMEIF "%CHANGE%"=="y" goto :NAMEIF "%CHANGE%"=="NO" goto :REGISTRYIF "%CHANGE%"=="no" goto :REGISTRYIF "%CHANGE%"=="nO" goto :REGISTRYIF "%CHANGE%"=="No" goto :REGISTRYIF "%CHANGE%"=="N" goto :REGISTRYIF "%CHANGE%"=="n" goto :REGISTRYECHO Error! Please Try again...goto :CHANGE:REGISTRYREG ADD %KEY%goto :END:ENDECHO.SET /P Exit=Press Enter to Exit...exitCOMPANYNAME.cmd@echo offTITLE=Post Windows Setup CustomizationSET KEY=???ECHO Type in the Name of yourECHO Company and then press Enter:COMPANYNAMEECHO.SET /P COMPANYNAME=Company Name:ECHO Your input was: %COMPANYNAME%ECHO Type in YES to Change it or NO to Confirm.:CHANGESET /P CHANGE=Change:IF "%CHANGE%"=="YES" goto :COMPANYNAMEIF "%CHANGE%"=="yes" goto :COMPANYNAMEIF "%CHANGE%"=="Yes" goto :COMPANYNAMEIF "%CHANGE%"=="yEs" goto :COMPANYNAMEIF "%CHANGE%"=="yeS" goto :COMPANYNAMEIF "%CHANGE%"=="YeS" goto :COMPANYNAMEIF "%CHANGE%"=="YEs" goto :COMPANYNAMEIF "%CHANGE%"=="NO" goto :REGISTRYIF "%CHANGE%"=="no" goto :REGISTRYIF "%CHANGE%"=="nO" goto :REGISTRYIF "%CHANGE%"=="No" goto :REGISTRYECHO Error! Please Try again...goto :CHANGE:REGISTRYREG ADD %KEY%goto :END:ENDECHO.SET /P END=Press Enter to Exit...exit%KEY% in Each one is where the Appropriate Reg Entry is and the Variable set in the file is what will be Actually added as the "String Value".EDIT 2: If it is Possible to Simplify the Stuff under :Change, any advice would be much appreciated. Edited October 4, 2006 by mandrake10 Link to comment Share on other sites More sharing options...
mazin Posted October 4, 2006 Share Posted October 4, 2006 I'm sorry, mandrake10. You'd better use cancerface's CreateUser utility. Link to comment Share on other sites More sharing options...
jaclaz Posted October 4, 2006 Share Posted October 4, 2006 (edited) A couple of ideas:@echo off:CHANGESET /P CHANGE=Change:For %%A in (YES YEs Yes yes yeS yES yEs YeS NO No no nO) DO IF %%A.==%CHANGE%. GOTO :Nextstep%CHANGE%ECHO Error! Please Try again...goto :CHANGE:NextstepYESREM was :COMPANYNAMEECHO COMPANYNAME %CHANGE%PAUSEgoto :CHANGE:NextstepNOREM was :REGISTRYECHO REGISTRY %CHANGE%PAUSEgoto :CHANGE@echo off:CHANGESET /P CHANGE=Change:ECHO %CHANGE% | FIND /I "YES " >nulIF %ERRORLEVEL%==0 goto :COMPANYNAMEECHO %CHANGE% | FIND /I "NO " >nulIF %ERRORLEVEL%==0 goto :REGISTRYECHO Error! Please Try again...goto :CHANGE:COMPANYNAMEECHO COMPANYNAME %CHANGE%PAUSEgoto :CHANGE:REGISTRYECHO REGISTRY %CHANGE%PAUSEgoto :CHANGEPlease note that in your source you missed a couple of combination for "yEs"....jaclaz Edited October 4, 2006 by jaclaz Link to comment Share on other sites More sharing options...
nakira Posted October 4, 2006 Share Posted October 4, 2006 IF has a switch to do case insensitive comparisons.IF /I "blah" == "BLAH" <command> Link to comment Share on other sites More sharing options...
Yzöwl Posted October 4, 2006 Share Posted October 4, 2006 IF has a switch to do case insensitive comparisons.<HTML><HEAD> <TITLE>Owner Company & PC Name</TITLE> <HTA:APPLICATION applicationname="Owner Company & PC Name" maximizebutton="no" minimizebutton="no" scroll="no" showintaskbar="no" singleinstance="yes" /></HEAD><script language="VBScript"> Sub regEdit strOrg = TextBox0.Value strName = TextBox1.Value strPC = TextBox2.Value Set oFS = CreateObject("Scripting.FileSystemObject") If strOrg = "" Then MsgBox "You need to fill in " & chr(34) & "Company" & chr(34),64,"Alert" document.getElementByID("textbox0").select ElseIf strName = "" Then MsgBox "You need to fill in " & chr(34) & "Owner" & chr(34),64,"Alert" document.getElementByID("textbox1").select ElseIf strPC = "" Then MsgBox "You need to fill in " & chr(34) & "PC Name" & chr(34),64,"Alert" document.getElementByID("textbox2").select Else Set strScript = oFS.OpenTextFile("Add2Reg.vbs",8,True) strScript.WriteLine "Set oShell = WScript.CreateObject(" & chr(34) & "WScript.Shell" & chr(34) & ")" strScript.WriteLine "Set oFS = CreateObject(" & chr(34) & "Scripting.FileSystemObject" & chr(34) & ")" strScript.WriteLine "strRoot = " & chr(34) & "HKLM" & chr(34) strScript.WriteLine "strOne = " & chr(34) & "\SOFTWARE\Microsoft\Windows NT\CurrentVersion\" & chr(34) & "" strScript.WriteLine "strTwo = " & chr(34) & "\System\CurrentControlSet\Control\ComputerName\ComputerName\" & chr(34) & "" strScript.WriteLine "strOrg = " & chr(34) & strOrg & chr(34) strScript.WriteLine "strName = " & chr(34) & strName & chr(34) strScript.WriteLine "strPC = " & chr(34) & strPC & chr(34) strScript.WriteLine "oShell.RegWrite strRoot & strOne & " & chr(34) & "RegisteredOrganization" & chr(34) & ", strOrg" strScript.WriteLine "oShell.RegWrite strRoot & strOne & " & chr(34) & "RegisteredOwner" & chr(34) & ", strName" strScript.WriteLine "oShell.RegWrite strRoot & strTwo & " & chr(34) & "ComputerName" & chr(34) & ", strPC" strScript.WriteLine "oFS.DeleteFile(WScript.ScriptFullName)" strScript.Close call runScript End If End Sub Sub runScript Set oShell = CreateObject("WScript.Shell") oShell.Run "Add2Reg.vbs" End Sub Sub reload window.location.reload End Sub Sub bodyLoaded() window.ResizeTo 402,220 ' WIDTH, HEIGHT TextBox0.focus() End Sub</SCRIPT><BODY onLoad="bodyLoaded()" STYLE="font:12 pt arial; color:white; filter:progid:DXImageTransform.Microsoft.Gradient (GradientType=1, StartColorStr='#000000', EndColorStr='#00CC00')"> <TABLE width="90%" border="0" cellpadding="6" align="left"> <COLGROUP width="100%"> <COL width="12%"> <COL width="44%"> <COL width="44%"> </COLGROUP> <TR> <TD><B>» Company :</B></TD> <TD colspan="2"><input type="text" size="36" name="textbox0"></TD> </TR> <TR> <TD><B>» Owner       :</B></TD> <TD colspan="2"><input type="text" size="36" name="textbox1"></TD> </TR> <TD><B>» PC</B> <B>Name  :</B></TD> <TD colspan="2"><input type="text" size="36" name="textbox2"></TD> <TR> <TD align="left" valign="bottom"><font color="white" size="1">Yzöwl ©2006</font></TD> <TD align="right"><input type="button" value="Submit Data" name="run_button" onClick="regEdit"></TD> <TD align="right"><input type="button" value="Cancel" name="close_button" onClick="Self.Close"></TD> </TR> </TABLE></BODY>GSM, will probably be able to improve it too! Link to comment Share on other sites More sharing options...
gunsmokingman Posted October 4, 2006 Share Posted October 4, 2006 (edited) Thank You YzöwlI have made some cosmetic changes to what you have done <!-- ORIGINAL HTA AND SCRIPT BY YZOWL HTA RE EDIT BY GUNSMOKINGMAN --><HTML><HEAD> <TITLE>Owner Company & PC Name</TITLE> <HTA:APPLICATION applicationname="Owner Company & PC Name" maximizebutton="no" minimizebutton="no" scroll="no" showintaskbar="no" 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:8.25pt; 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 Transparent; border-right: 2px Transparent; border-top: 3px Transparent; border-Bottom: 2px Transparent; } </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. If Any<BR>' + 'Text Box Is Not Filled In It Will Not 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 All Text'} else {Clear_Button.value ='Clear Text';}} /* CLOSE BUTTON CHANGE TEXT -> */ function Button3ChangeText() { if (Close_Button.value =="Close App") {Close_Button.value ='Good Bye'} else {Close_Button.value ='Close App';}} </SCRIPT> <script language="VBScript"> Dim strName, strOrg, strPC '/-> TEXT BOXES SCRIPTS Function RegEdit() strOrg = TextBox0.Value : strName = TextBox1.Value : strPC = TextBox2.Value If strOrg = "" Then window.alert "Alert" & vbcrlf & "You need to fill in " & chr(34) & "Company" & chr(34) document.getElementByID("textbox0").select ElseIf strName = "" Then window.alert "Alert" & vbcrlf & "You need to fill in " & chr(34) & "Owner" & chr(34),64,"Alert" document.getElementByID("textbox1").select ElseIf strPC = "" Then window.alert "Alert" & vbcrlf & "You need to fill in " & chr(34) & "PC Name" & chr(34),64,"Alert" document.getElementByID("textbox2").select Else Set strScript = Fso.CreateTextFile("Add2Reg.vbs") strScript.WriteLine "Set Act = CreateObject(" & chr(34) & "WScript.Shell" & chr(34) & ")" strScript.WriteLine "Set Fso = CreateObject(" & chr(34) & "Scripting.FileSystemObject" & chr(34) & ")" strScript.WriteLine "strRoot = " & chr(34) & "HKLM" & chr(34) strScript.WriteLine "strOne = " & chr(34) & "\SOFTWARE\Microsoft\Windows NT\CurrentVersion\" & chr(34) & "" strScript.WriteLine "strTwo = " & chr(34) & "\System\CurrentControlSet\Control\ComputerName\ComputerName\" & chr(34) & "" strScript.WriteLine "strOrg = " & chr(34) & strOrg & chr(34) strScript.WriteLine "strName = " & chr(34) & strName & chr(34) strScript.WriteLine "strPC = " & chr(34) & strPC & chr(34) strScript.WriteLine "Act.RegWrite strRoot & strOne & " & chr(34) & "RegisteredOrganization" & chr(34) & ", strOrg" strScript.WriteLine "Act.RegWrite strRoot & strOne & " & chr(34) & "RegisteredOwner" & chr(34) & ", strName" strScript.WriteLine "Act.RegWrite strRoot & strTwo & " & chr(34) & "ComputerName" & chr(34) & ", strPC" strScript.WriteLine "Fso.DeleteFile(WScript.ScriptFullName)" strScript.Close call RunScript End If End Function '/-> RUN NEW SCRIPT Function RunScript() : Act.Run("Add2Reg.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 402,220 : TextBox0.focus() : End Function </SCRIPT> </HEAD><BODY><CENTER> <!-- TEXT BOX TABLE START --><TABLE width='90%' border='0' cellpadding='6'><TD> <!-- TEXT BOX 01 START --> <TABLE><TD Width='125'><B>» Company</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>» Owner</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>» PC Name</TD><TD> :</B></TD> <TD colspan="2"><Input type="text" Class='TextBackGround' size="36" name="textbox2"></TD> </TABLE></TD> <!-- TEXT BOX TABLE END --></TABLE> <!-- 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> <!-- YZOWL TABLE START --> <TABLE><TD WIDTH='300' HEIGHT='32' Style='font:8.75pt;Color:"#E1E1E1"'><SPAN ID='Txt1'></SPAN></TD> <TD><FONT color="#E1E1E1" size="1.25">Yzöwl ©2006</FONT></TD></TABLE> <!-- YZOWL TABLE END --> </BODY></HTML>I have included the hta in a rar fileChangeComputerInfo.rar Edited February 10, 2007 by gunsmokingman Link to comment Share on other sites More sharing options...
Beta4Me Posted October 5, 2006 Author Share Posted October 5, 2006 (edited) Thanks guys (or girls, ) for your help, it is very appreciated. Now i hope i can help you one day.EDIT: Hello, . Code tweaked by Mua:<!-- ORIGINAL HTA AND SCRIPT BY YZOWL HTA EDIT BY GUNSMOKINGMAN HTA RE-EDIT BY BETA4ME --><HTML><HEAD> <TITLE>Owner, Organization & PC Name</TITLE> <HTA:APPLICATION applicationname="Owner, Organization & PC Name" 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 strName, strOrg, strPC '/-> TEXT BOXES SCRIPTS Function RegEdit() strOrg = TextBox0.Value : strName = TextBox1.Value : strPC = TextBox2.Value If strOrg = "" Then window.alert "Alert" & vbcrlf & "You need to fill in " & chr(34) & "Organization" & chr(34) document.getElementByID("textbox0").select ElseIf strName = "" Then window.alert "Alert" & vbcrlf & "You need to fill in " & chr(34) & "Owner" & chr(34),64,"Alert" document.getElementByID("textbox1").select ElseIf strPC = "" Then window.alert "Alert" & vbcrlf & "You need to fill in " & chr(34) & "PC Name" & chr(34),64,"Alert" document.getElementByID("textbox2").select Else Set strScript = Fso.CreateTextFile("Add2Reg.vbs") strScript.WriteLine "Set Act = CreateObject(" & chr(34) & "WScript.Shell" & chr(34) & ")" strScript.WriteLine "Set Fso = CreateObject(" & chr(34) & "Scripting.FileSystemObject" & chr(34) & ")" strScript.WriteLine "strRoot = " & chr(34) & "HKLM" & chr(34) strScript.WriteLine "strOne = " & chr(34) & "\SOFTWARE\Microsoft\Windows NT\CurrentVersion\" & chr(34) & "" strScript.WriteLine "strTwo = " & chr(34) & "\System\CurrentControlSet\Control\ComputerName\ComputerName\" & chr(34) & "" strScript.WriteLine "strThree = " & chr(34) & "\System\ControlSet001\Control\ComputerName\ComputerName\" & chr(34) & "" strScript.WriteLine "strFour = " & chr(34) & "\System\ControlSet002\Control\ComputerName\ComputerName\" & chr(34) & "" strScript.WriteLine "strFive = " & chr(34) & "\System\CurrentControlSet\Control\ComputerName\ActiveComputerName\" & chr(34) & "" strScript.WriteLine "strSix = " & chr(34) & "\System\ControlSet001\Control\ComputerName\ActiveComputerName\" & chr(34) & "" strScript.WriteLine "strOrg = " & chr(34) & strOrg & chr(34) strScript.WriteLine "strName = " & chr(34) & strName & chr(34) strScript.WriteLine "strPC = " & chr(34) & strPC & chr(34) strScript.WriteLine "Act.RegWrite strRoot & strOne & " & chr(34) & "RegisteredOrganization" & chr(34) & ", strOrg" strScript.WriteLine "Act.RegWrite strRoot & strOne & " & chr(34) & "RegisteredOwner" & chr(34) & ", strName" strScript.WriteLine "Act.RegWrite strRoot & strTwo & " & chr(34) & "ComputerName" & chr(34) & ", strPC" strScript.WriteLine "Act.RegWrite strRoot & strThree & " & chr(34) & "ComputerName" & chr(34) & ", strPC" strScript.WriteLine "Act.RegWrite strRoot & strFour & " & chr(34) & "ComputerName" & chr(34) & ", strPC" strScript.WriteLine "Act.RegWrite strRoot & strFive & " & chr(34) & "ComputerName" & chr(34) & ", strPC" strScript.WriteLine "Act.RegWrite strRoot & strSix & " & chr(34) & "ComputerName" & chr(34) & ", strPC" strScript.WriteLine "Fso.DeleteFile(WScript.ScriptFullName)" strScript.Close call RunScript End If End Function '/-> RUN NEW SCRIPT AND THEN DELETE THE SCRIPT Function RunScript() : Act.Run("Add2Reg.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>» Organization</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>» Owner</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>» PC Name</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>Tell me what you think! Edited October 6, 2006 by mandrake10 Link to comment Share on other sites More sharing options...
Beta4Me Posted October 5, 2006 Author Share Posted October 5, 2006 (edited) Bugger, the Reg Entries in there DON'T change the Computer Name. Org & Owner Name's work but Computer Name don't, any help please. EDIT: NVM. The My Computer Properties shows the old Name . But Windows actually recognizes it as the new name . Weird, huh . Is there some-way to "Refresh" or "Update" the dialogue? Plzzzz...EDIT 2: Even after Reboots still shows old name. Edited October 6, 2006 by mandrake10 Link to comment Share on other sites More sharing options...
jaclaz Posted October 5, 2006 Share Posted October 5, 2006 OK, just for the record, now that everyone has had his part of fun and hopefully mandrake10 has learned a few neat tricks, why not using a more featured, pre-made FREEWARE and OPEN SOURCE app?:http://gravityfx.org/http://gravityfx.org/?id=projectshttp://gravityfx.org/?id=wxp(a .NET solution, so not really useful unless you need .NET for any other more meaningful reason)jaclaz Link to comment Share on other sites More sharing options...
Beta4Me Posted October 6, 2006 Author Share Posted October 6, 2006 (edited) OK, just for the record, now that everyone has had his part of fun and hopefully mandrake10 has learned a few neat tricks, why not using a more featured, pre-made FREEWARE and OPEN SOURCE app?:http://gravityfx.org/http://gravityfx.org/?id=projectshttp://gravityfx.org/?id=wxp(a .NET solution, so not really useful unless you need .NET for any other more meaningful reason)jaclazThanks for that, it's got tonnes of Tweak Settings, but would take too long to use to Mod my system. If you read my posts up above; I need to Edit the Computer Name, Owner's Name & Organization's Name ONLY. My CMD's work fine, and the HTA is great (Nice GUI). It does what i need it to do no more, no less. My Reg tweaks are imported during the Windows Setup and RunOnceEx, so i do not need to tweak anything more.If someone could answer this question:EDIT: NVM. The My Computer Properties shows the old Name . But Windows actually recognizes it as the new name . Weird, huh. Is there some-way to "Refresh" or "Update" the dialogue? Plzzzz...EDIT 2: Even after Reboots still shows old name.that is all I need , thanks... Edited October 6, 2006 by mandrake10 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now