remush Posted October 19, 2010 Posted October 19, 2010 Hi all,I'm trying to automat the installation of office 2003 as much as possible.Please view the below script to see how far I've gotten so far.---------------------------- install.batcls@echo offecho Please Enter the Office 2003 license key, without the - seperatorSET /P prodkey=setup.exe TRANSFORMS="Unattended.MST" /qb+ /l pidkey=%prodkey%-----------------------------This will prompt the user to enter a key, the only problem is that the license key the user enters remains visable on screen for the duration of the silent install. Is there a way to get input from the user, but to hide it in some way ? Such as when you type in your password in a form, its displayed as *********Thanks in advance,Remush
gunsmokingman Posted October 19, 2010 Posted October 19, 2010 Perhaps try this, but problem with the above code is there is no error control.@Echo OffCLSTitle Office 2003 InstallMode 77,9Color F9Echo.Echo Please Enter the Office 2003 license key, without the - seperatorSET /P prodkey=CLSEcho.Echo Installing Office 2003 this will tale a few minutes to be completed.setup.exe TRANSFORMS="Unattended.MST" /qb+ /l pidkey=%prodkey%Here is a VBS script that will waits until the 25 characters for the key hasbeen enter. To close the script Inputbox without adding the key is to type either exit or quit.Save As Ofc2003Install.vbsDim UserIn'-> Loop To Wait For The 25 Character Key Do While Len(UserIn) < 25 UserIn = InputBox( _ "Enter in the Office 2003 license key." & vbcrlf & _ "Without using the - seperator" & vbcrlf & _ "Type Exit Or Quit to stop install" ,"Office Key Input","",,475)'-> Quit Or Exit Case Insensitive If InStr(1,UserIn,"quit",1) Or InStr(1,UserIn,"exit",1) Then WScript.Quit(0) End If'-> Error To Few Characters If Len(UserIn) =< 24 Then MsgBox "The Needs To Be 25 Characters Not This Many : " & Len(UserIn),4128,"Error To Few Characters" UserIn = "" End If '-> Correct Amount Of Characters, Start Install Office 2003 If Len(UserIn) = 25 Then CreateObject("Wscript.Shell").Run("setup.exe TRANSFORMS=" & _ Chr(34) & "Unattended.MST" & Chr(34) & " /qb+ /l pidkey=" & UserIn),1,True WScript.Quit(1) End If'-> Error To Many Characters If Len(UserIn) >= 26 Then UserIn = "" MsgBox "To Many Characters Press Ok To Continue",4128,"Error To Many Characters" End If LoopI have attach Ofc2003Install.vbs.txt just rename it to Ofc2003Install.vbs
jaclaz Posted October 19, 2010 Posted October 19, 2010 This is a recurrent question.Some, more than solutions, workarounds:http://www.dostips.com/forum/viewtopic.php?p=602http://www.ericphelps.com/batch/samples/samples.htmhttp://www.robvanderwoude.com/vbstech_ui_password.phphttp://www.computing.net/answers/dos/how-do-i-hide-keyboard-input-in-a-batch-/7152.htmlhttp://stackoverflow.com/questions/664957/can-i-mask-an-input-text-in-a-bat-filehttp://www.devproconnections.com/article/jscript/scripting-password-prompts-.aspxhttp://www.westmesatech.com/editv.htmlAmazing what a simple google seach can find....jaclaz
remush Posted October 20, 2010 Author Posted October 20, 2010 Thanks for the code gunsmokingman I have used your vbs file verbatim and it works great.I've burnt it to cd along with the rest of the office 2003 install Files.The ADRA Logan community centre thanks your help !!!http://adralogan.weebly.com/Regards,Remus
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now