Jump to content

MHz

Member
  • Posts

    1,691
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Australia

Everything posted by MHz

  1. I have little knowledge with inf files though something like [Stop.MicrosoftUpdate]11,,sc.exe,,,"stop wuauserv"[Start.MicrosoftUpdate]11,,sc.exe,,,"start wuauserv"may do?
  2. Try stopping the Windows Update service. Commands like net stop wuauservand to start net start wuauservOr you could use sc.exe. Use sc /? at a cmd prompt for more information of use. This page below shows some commands used in a cmd script. Perhaps more then you need. You can convert to inf format. http://wuauclt.info/scripts.asp
  3. Not needed in your case as the command string does not start with a double quote and end with a double quote. I saw all the double quotes and considered mentioning the /S yet after I posted I noticed that the command string begins with the command Set with double quotes coming later in the string. If you do have a command string starting and ending with double quotes like (omitting the CMD /Q /C stuff being shown, rather just the command string) "path\to\file.exe" > "path\to\logfile.log"then CMD may strip the outer double quotes following legacy conditions. So it would be executed as path\to\file.exe" > "path\to\logfile.logwhich would fail as the redirection character is now double quoted with the white space. Apologies for any confusion. You can still use the /S and use extra double quotes if you want though it is not needed with your command line shown.
  4. Something to learn from this example. The command string should follow /C or /K. Not using /C or /K immediately before the command string can expect failure. V:ON would be an invalid parameter as a leading forward slash would be expected. CMD seems to ignore V:ON and thus delayed expansion is not turned on. The command string has more then 2 double quotes. CMD may strip outer double quotes which may leave the command string as invalid. I would add extra outer double quotes on the command string and use the /S parameter to force CMD to strip those outer double quotes to be safe. This information can be viewed by using the command CMD /? . Following the information I mentioned above, I would use CMD /S /Q /V:ON /C "SET "FM=FolderName" & ECHO "!FM!""which tests as working.
  5. I doubt the corrections you made are fixing anything. Seems you misunderstand the operation of what the script is doing. The delimited file of Computername.txt.txt is not a mistake, but rather deliberate with adding a 2nd extension on the original filename to create another filename for use. Example: Computername.txt is created with initial information. The information is used and changes are recorded to Computername.txt.txt. At the end of the script, Computername.txt.txt is moved over to overwrite Computername.txt. This is done as the script can not read and write to the same file with out messing it up. So Computername.txt.txt is actually a temporary file that later replaces the original file named Computername.txt. Perhaps I could have made a temporary filename more unique though I chose for an easy method. I could summarize the script though you may not be able to link what words to what code. I will rather comment the code more and so that you can see what each line of code is doing. I included the pause at the end of the script and the progress output like how Yzöwl mentioned. Heavier commented code: Edit: Upon review and to avoid further confusion with the .txt and .txt.txt use of file handling, I have done a small change by using .txt and .txt.tmp as the later has a better reference to actually being a temporary file.
  6. To pause the script, add pause before the goto :eof near the end of the script. pauseendlocalgoto :eofThe systeminfo.txt file does have the installed updates. Once the updates.txt file is created then systeminfo.txt is not needed anymore so it could be deleted though I did not add that as it shows you the evidence of what happened. The updates.txt file is a tab delimited file where the first column is 1 for installed and 0 as not installed yet. As an install happens then it will be recorded and the 0 will change to a 1. The 2nd column is the path to the msu files. Remember to remove the ECHO that is in uppercase to execute wusa else it will just print the command to screen. You can change the settings of the 4 variables named systeminfo, updates, limit and wmi at the top of the script. So you can change the systeminfo variable like below. :: The filepath used to save the KB information.set "systeminfo=%~dp0%computername%.txt"That will create the computername text file that you ask about. Test output:
  7. @crobertson I guess you are replying to me? I have looked at your requests and created a script based on those requests. It saves the installed hotfixes read from systeminfo\wmi to a file and creates a updates text file with the msu files and their installed state. It has a limit variable so if you have say 200 msu files and want to install in 3 separate executions, then you could set the variable to 70. It would then stop at 70 installs. The next execution of the script would do the next 70 installs. The updates text file will be updated with the istalled status at each script execution. The execution of systeminfo\wmi is done just once so later script executions should perform faster based solely on the updates text file. Using variable substitution instead of using find.exe speeds up the script as well. @echo offsetlocal enabledelayedexpansion:: Note: Remove the ECHO in front of the wusa keyword to enable installations.:: The delimiters in the saved files are tabs.:: Update the values of the next 4 set variables if needed.:::: The filepath used to save the KB information.set "systeminfo=%~dp0systeminfo.txt":::: The filepath used to save the msu filepaths and the installed status.set "updates=%~dp0updates.txt":::: Limit number of KB hotfix installs during current script execution.set /a "limit=9999":::: Use wmi instead of systeminfo. Use 0 for systeminfo.exe.set "wmi=1"if not exist "%updates%" ( rem Find installed KB numbers from wmi\systeminfo and save to file. if "%wmi%" == "0" ( for /f "tokens=2" %%A in ('systeminfo^|findstr /i "\<KB[0-9][0-9]*$"') do ( (echo %%A) >> "%systeminfo%" ) ) else ( for /f "tokens=1" %%A in ('wmic qfe get hotfixid') do ( set "hotfixid=%%~A" if /i "!hotfixid:~0,2!" == "KB" (echo %%~A) >> "%systeminfo%" ) set "hotfixid=" ) if not exist "%systeminfo%" echo.>"%systeminfo%" rem Find msu files and save to file with the installed status. for /R "%~dp0" %%U in (*.msu) do ( set installed=0 for /f "usebackq" %%I in ("%systeminfo%") do ( call :find "%%~nU" "%%I" if not errorlevel 1 set installed=1 ) (echo !installed! %%~U) >> "%updates%" ) set "installed="):: View updates text file.echo #### BEFORE INSTALLStype "%updates%"for /f "usebackq tokens=1,2 delims= " %%A in ("%updates%") do ( set "installed=%%~A" set "filepath=%%~B" rem Perform install if required and echo install status to the updates text file. if "!installed!" == "0" ( set /a "count+=1" if !count! leq %limit% ( ECHO wusa "!filepath!" /quiet /norestart (echo 1 !filepath!) >> "%updates%.txt" ) else ( (echo 0 !filepath!) >> "%updates%.txt" ) ) else if "!installed!" == "1" ( (echo 1 !filepath!) >> "%updates%.txt" ) else ( (echo Unknown install status of "!filepath!") >&2 ))set "installed="set "filepath="rem Move updates file to overwrite previous file.move /y "%updates%.txt" "%updates%" >nul:: View updates text file again.echo #### AFTER INSTALLStype "%updates%"endlocalgoto :eof:: Find a substring in a string by using substitution.:find setlocal enabledelayedexpansion set string=%~1 set substring=%~2 if /i "!string:%substring%=!" == "!string!" ( endlocal & exit /b 1 ) endlocalexit /b 0This line below from the script will just echo the command for testing. Remove the ECHO keyword to enable wusa to execute. ECHO wusa "!filepath!" /quiet /norestartSome of the TYPE commands can also be removed as they exist for validation purposes. I have tested on some dummy msu files and it seems to be working ok. Try it and see how it performs for you.
  8. If the installer is running as admin and your AutoIt script is running as a standard user then automation issues may occur. Add this directive to the top of the script to run the script as admin. #RequireAdminAdd this directive to the top of the script to run a compiled script as admin. This adds the require admin to the resources of the executable. #pragma compile(ExecLevel, requireAdministrator)Have a look in the AutoIt help file for Tutorials > WinZip Installation. If you can follow that tutorial then perhaps you can progress to using the Control* functions. Looks like the latest WinZip is about 10 versions higher then the tutorial version so some subtle differences may exist. If you have further issues with your attempts, then post your attempts and help may follow. Also have a look at the pinned topic of AutoIT Script Collection for some examples.
  9. I am a rather new with PowerShell though here is an example. It started lean, yet testing threw errors that I addressed i.e non existing paths etc. Tested with PowerShell 4.0. Edit: The Documents folders is a Shell Folder. I have no Shell Folders in %UserProfile% as they exist on another partition on the main drive and the system has recorded this move. The code below is a registry option to get a path of a Shell Folder i.e "Personal" which is the My Documents path. I chose not to change the code above with this code and leave it as an option.
  10. Since it is a sort of known path, then perhaps a tag file could be used like many others use (probably with the path in it) or even a script put in the root of the drive to set certain variables. I.e. oem.cmd rem Paths to RunOnceEx folderset oem=%~dp0subfolder\oem\set runonceex=%~dp0subfolder\oem\runonceex\main.cmd (searchs for oem.cmd and calls it if it exist) @echo offsetlocal enabledelayedexpansionecho %time%for %%A in (c d e f g h i j k l m n o p q r s t u v w x y z) do ( set drive=%%A: if exist !drive! ( if exist !drive!\oem.cmd call !drive!\oem.cmd ))echo %time%if defined oem echo oem = !oem!if defined runonceex echo runonceex = !runonceex!pauseendlocalgoto :eofoutput: 3:15:17.36 3:15:17.39oem = e:\subfolder\oem\runonceex = e:\subfolder\oem\runonceex\Press any key to continue . . .Just one of many alternatives that could be used.
  11. Right-click a file. Select the Properties item. On the General tab, change file extension in the top edit control that displays the filename.Seems easy enough. I usually show extensions all the time so I do not need to do this extra step.
  12. The script in the 1st post has been tested here as working in Windows 7 X64. I do not see how it can fail unless %FoundFile% contained some special characters which possibly could foul it up. It even looks rather similar to the code in the link that jaclaz posted that was done by Yzöwl. I can not fix something that is not broken. Can only suggest to use delayed expansion with the variables to help avoid character issues.
  13. Thanks jaclaz. It is probably a good torch. I probably need some good eyes rather then a good torch. The price tag is probably bumped up a bit high for my liking. Makes me think of a keyboard in comparison with complexity. Many factors determine what I may buy and what I will not. As for my code, I am just getting started . Its 100% free so someone can take it or leave it. For an limited time, I will offer 50% off. Thats right, a huge 50% off. Get it while it lasts .
  14. Perhaps if your open to suggestion about the logging format, then perhaps the structure of a database might be better for saving multiple amounts of data. The example I show is using a 3rd party database tool known as SQLite and is used for local file based databases for applications and scripts. If you do not know SQL, then perhaps it may give you a reason to learn something new. This script executes the commands, saves the data to a sql file and then it is read in by sqlite3.exe to be inserted into the database. It will then display you some results by accessing the database. 1 table named logs with 2 columns named name and data. Both columns are set as type text. @echo offsetlocal enabledelayedexpansion@set prompt=::$G$S:: Just for clean, repetitive testing. Can be removed.if exist logs.db del logs.db:: Require::: sqlite-shell-win32-x86-3080701.zip (version number changes. File inside zip is sqlite3.exe):: download from http://www.sqlite.org/download.html:: Create the database if not exist and create the logs table.if not exist logs.db ( sqlite3 logs.db "create table logs (name TEXT, data TEXT);"):: Add begin transaction.echo begin;> tmp.sql:: Add insert values. Use 0 for 3rd parameter to not execute the 2nd parameter.call :addValues "TestName1" "echo Hello World"call :addValues "TestName2" "Hello Sun" "0"call :addValues "DirOutput" "dir /b"call :addValues "PingGoogle" "ping www.google.com"call :addValues "IPConfigAll" "ipconfig /all":: Add commit transaction.echo commit;>> tmp.sql:: Read the sql transaction file into the database.if exist logs.db if exist tmp.sql ( sqlite3 -cmd ".read tmp.sql" logs.db ""):::: Test database access.if exist logs.db ( :: Display data value of TestName1 from logs.db and store in a variable. echo 1. Select data from logs where name = 'TestName1'; for /f "usebackq delims=" %%A in ( `sqlite3 logs.db "select data from logs where name = 'TestName1';"` ) do set "data=%%A" echo !data! echo. :: Display all values of TestName2 from logs.db. echo 2. Select * from logs where name = 'TestName2'; sqlite3 -cmd ".mode line" logs.db "select * from logs where name = 'TestName2';" pause :: Display all values from logs.db. echo 3. Select * from logs; sqlite3 -cmd ".mode line" logs.db "select * from logs;" pause)endlocalgoto :eof:addValues setlocal enabledelayedexpansion :: 1st value. Idea of echo without newline from http://stackoverflow.com/questions/7105433/windows-batch-echo-without-new-line set "line=%~1" set "reply=" @echo | set /p "reply=insert into logs values ^('!line:'=''!','">> tmp.sql :: 2nd value. Executes the command and echos each line to a sql file. set "line=" if /i "%~3" == "0" ( :: Just the text with no newline. echo | set /p "reply=%~2">> tmp.sql ) else ( :: Execute and echo the output. for /f "delims=" %%A in ('%~2') do @( set "line=%%A" set "line=!line:'=''!" echo !line! ) ) >> tmp.sql echo '^);>> tmp.sql endlocalgoto :eofI will show only the output of the 1st 2 display outputs as the 3rd which displays all values is long, due to IPConfig /all etc. 1. Select data from logs where name = 'TestName1';Hello World2. Select * from logs where name = 'TestName2'; name = TestName2 data = Hello SunEnsure sqlite3.exe in the current directory or %path% to test.
  15. The %variables% inside the rounded braces will be evaluated before executing the code line so they are empty. Using delayed expansion !variables! allows them to expand at execution time so they are updated at that time. So changing the % to ! makes your code work. setlocal enabledelayedexpansionfor /f "tokens=*" %%A in (paths.txt) do ( set drive=%%~dA If Defined drive ( set drive=!drive:~0,1! ) echo !drive!)So a minor change and it works. I get the letter E echoed.
  16. yro, The update files have a KB number in the filenames and systeminfo gives KB numbers installed so I looked at how the data could be used to set which filename to allow to be installed. This is a test script I came up with. @echo offsetlocal enabledelayedexpansion:: Set a counter for the KB[i] series of variablesset i=0:: Find installed KB numbers from systeminfo and add to KB[i] variablesfor /f "tokens=2" %%A in ('systeminfo^|findstr /i "\<KB[0-9][0-9]*$"') do ( set /a i += 1 set KB[!i!]=%%A):: Set ubound to 1st KB variableset KB[0]=%i%:: Loop through recursive search for msu files:: In each filename, find KB number, if not found then install filename:: Remove the echo in front of wusa used in testing to execute the wusa:: command and remove the pause linefor /R "%~dp0" %%U in (*.msu) do ( set /a count += 1 set installed=0 echo Instalando !count! de %z% = %%~nU timeout /t 3 > nul for /l %%I in (1, 1, %KB[0]%) do ( echo %%~nU| find /i "!KB[%%I]!"> nul @if not errorlevel 1 set installed=1 ) @if !installed! equ 0 echo wusa "%%U" /quiet /norestart)endlocalpausegoto :eofIt puts each KB string into a variable KB where i is a numbered index (like how an array on access works). That makes the data easier to loop through many times over. If the KB string is found in the filename, then installed is set to 1 so installation will not happen. Edit: Added /i to find and findstr so case sensitivity would not be an issue.
  17. Hi ramoyous, I doubt that you would want an separate email sent with each line containing "alarm". Why not send all of the lines in 1 email. StringRegExp() may do the searching for "alarm" in the files content. I have changed the main body of the code and I will not repost the UDFs. You should hopefully understand the start and end markers of where the code is to be inserted. ;##################################; Script;##################################; First we read the text file$sLog = FileRead($TextFileName); Search for 'alarm' using PCRE.; Pattern. eol = CRLF, multiline mode, case insensitive, _; word breaks around 'alarm', ^ = start of line, $ = end of line$aLog = StringRegExp($sLog, '(*CRLF)(?mi)^.*\bAlarm\b.*$', 3)$sLog = ''; Concantenate from the array of matchesFor $i1 = 0 To UBound($aLog) -1 $sLog &= $aLog[$i1] & @CRLFNext; If $sLog is something, then attempt to send emailIf $sLog Then ; Array used by _INetSmtpMailCom() and MyErrFunc() Global $oMyRet[2] ; Register COM error handler Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") ; Send email message $Response = _INetSmtpMailCom( _ $SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, _ $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, _ $Username, $Password, $IPPort, $ssl _ ) ; _INetSmtpMailCom() @error check If @error Then MsgBox(0x40030, "Error sending message", _ "Error code:" & @error & " Description:" & $Response _ ) EndIfEndIf;; The UDFAs for the RegEx Test, I used this. #Region Create a test log file; Open a log to write to$hWrite = FileOpen('test.log', 2); Check that the write handle is validIf $hWrite = -1 Then Exit 1; Some test lines added to an arrayDim $lines[3] = [ _ 'Line 1', _ 'Alarm: Something failed.', _ 'Line 3' _]; Write 50 lines in random sequenceFor $i1 = 0 To 50 $iRandom = Random(0, UBound($lines) -1, 1) FileWriteLine('test.log', '[' & $i1 & '] ' & $lines[$iRandom])Next; Close the write handleFileClose($hWrite)#EndRegion#Region Read test log file and find 'alarm'; Read the whole file$sContent = FileRead('test.log'); Search for 'alarm'.; Pattern. eol = CRLF, multiline mode, case insensitive, _; word breaks around 'alarm', ^ = start of line, $ = end of line$aLog = StringRegExp($sContent, '(*CRLF)(?mi)^.*\bAlarm\b.*$', 3)$sLog = ''; Concantinate from the array of matchesFor $i1 = 0 To UBound($aLog) -1 $sLog &= $aLog[$i1] & @CRLFNext; If $sLog is something, then send mailIf $sLog Then MsgBox(0, 'Send Mail', $sLog)EndIf#EndRegion; CleanupFileDelete('test.log')HTH
  18. I like to experiment. A cmd script is just a plain text file so it can be read from. So I considered using FindStr to read the cmd file for lines beginning with a marker ::>. Seems to work ok and avoids using escapes on special characters. The :fileSave label does the reading and echos the matched lines to the new file. The ::> marker should not foul up anything as :: is usually treated as a comment line when it is at the start of the line. Hopefully I added enough comments in the script to help with understanding it. Tested on Windows 7. @echo off:: call label :fileSave. 1st parameter is file to read. 2nd parameter is file to save tocall :fileSave %0 example.cmdgoto :eof:: findstr pattern is::: ^ = Match at start of line:: ::> = Then this literal match:fileSave setlocal ENABLEDELAYEDEXPANSION :: if file exists, then do not continue this label code if exist "%~2" ( echo Error. File already exists 1>&2 endlocal & goto :eof ) for /f "tokens=*" %%a in ('findstr "^::>" "%~1"') do ( :: save to a simple variable so string handling can be done on it set line=%%a :: trim first 3 letters from the line set line=!line:~3! :: if not defined echo a empty line, else echo the line as is if not defined line ( echo.>> "%~2") else echo !line!>> "%~2" ) endlocalgoto :eof:: Conditions of use of lines read by findstr:: ------------------------------------------:: Lines need to start with ::> to be matched by findstr.:: Empty lines can just start with ::> on the line with no other text needed.:: Add lines between the REM markers to keep them grouped together.:: Do not start lines in other parts of the script with ::> else they will be matched by findstr.REM *** Start of text read by findstr ***::>:: Script by Pijano::>@echo off::>cls::>::>set selection=0::>echo id Selection::>echo -- ---------::>echo 0. Quit::>echo 1. Option1::>echo 2. Option2::>echo 3. Option3::>echo.::>set /p "selection=Prompt : "::>::>echo You chose %selection%. This outputs to stdout.::>::>if %selection% equ 0 goto :eof::>if %selection% equ 1 goto :opt1::>if %selection% equ 2 goto :opt2::>if %selection% equ 3 goto :opt3::>::>echo Error. You chose %selection%. This outputs to stdErr. 1>&2::>call :promptEndOfScript::>goto :eof::>::>:opt1::> echo label :opt1 commands::> call :promptEndOfScript::>goto :eof::>::>:opt2::> echo label :opt2 commands::> call :promptEndOfScript::>goto :eof::>::>:opt3::> echo label :opt3 commands::> call :promptEndOfScript::>goto :eof::>::>:promptEndOfScript::> echo Script complete. Press any key to continue.::> pause>nul::>goto :eofREM *** End of text read by findstr ***If you are wondering why I choose to redirect to con with some of the echoes, it prevents what is echoed going to stdout or stderr. So you can redirect the example.cmd to a log file and the menu and other echos redirected to con will not be echoed to file, but echoed to the screen. Edit: Removed the redirection to con as I do not see it as a benefit for common use. If you redirect the script for errors then you would just do stderr i.e. example.cmd 2> log.txt. Redirecting vital stdout to con can hinder applications or scripts that may want to interact with it by capturing stout and stderr. Also note that I have comments in the for loop. Sometimes putting comments in between the braces of a for loop or other braced commands do not like comments in there as well. If you have issues, then you can remove those comments. Testing seems fine so it maybe just rem comments that cause issue, not sure which at present.
  19. Upon another review, it looks like your text parameters are perhaps trimmed shorter from the right side of a string. AutoIt reads from the left. i.e. a complete text string from the window Do you want to begin install. This should work OK Do you want. This I expect not to work to begin installYou can choose any visible text line as a parameter though it needs to start from the left side. You want to pass a switch. That would be more reliable IMO. Adding the switch is as easy as putting it behind the last double quote in the command string. I will change the Run to RunWait as you do not need to interact with any windows. Run returns the Process ID in $pid while RunWait returns an exitcode in $pid. $pid = RunWait('msiexec.exe /i "C:\DATA\NEW Endpoint Encryption Framework Client v 8.2.0.msi" /qb')So it is the same as your command string but just with single quotes around the whole string.
  20. Give this a try with you 2 posted scripts. Hopefully I made no mistakes. #RequireAdminOpt('TrayIconDebug', 1)$pid = Run('msiexec.exe /i "C:\DATA\NEW Endpoint Encryption Framework Client v 8.2.0.msi"')If Not @error Then WinWait("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "will install symantec") ; wait WinActivate("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "will install symantec") ; force activate WinWaitActive("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "will install symantec") ; wait til active Send("{ENTER}") ; WinWait("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "Next to install this folder") WinActivate("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "Next to install this folder") WinWaitActive("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "Next to install this folder") Send("!N") ; WinWait("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "Click Install to begin") WinActivate("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "Click Install to begin") WinWaitActive("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "Click Install to begin") Send("!I") ; WinWait("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "has successfully installed") WinActivate("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "has successfully installed") WinWaitActive("Symantec Endpoint Encryption Framework Client - InstallShield Wizard", "has successfully installed") Send("!F") ; WinWait("Symantec Endpoint Encryption Framework Client", "must restart your system") WinActivate("Symantec Endpoint Encryption Framework Client", "must restart your system") WinWaitActive("Symantec Endpoint Encryption Framework Client", "must restart your system") Send("{TAB}") Send("{ENTER}") ; ProcessWaitClose($pid)EndIf$pid = Run ("C:\DATA\NetMotion_client_Win7.exe")If Not @error Then WinWait("NetMotion Mobility XE Client Setup", "strongly recommended") WinActivate("NetMotion Mobility XE Client Setup", "strongly recommended") WinWaitActive("NetMotion Mobility XE Client Setup", "strongly recommended") Send("!N") ; WinWait("NetMotion Mobility XE Client Setup", "NETMOTION WIRELESS") WinActivate("NetMotion Mobility XE Client Setup", "NETMOTION WIRELESS") WinWaitActive("NetMotion Mobility XE Client Setup", "NETMOTION WIRELESS") Send("!A") Send("!N") ; WinWait("NetMotion Mobility XE Client Setup", "Setup will install") WinActivate("NetMotion Mobility XE Client Setup", "Setup will install") WinWaitActive("NetMotion Mobility XE Client Setup", "Setup will install") Send("!N") ; WinWait("NetMotion Mobility XE Client Setup", "must know") WinActivate("NetMotion Mobility XE Client Setup", "must know") WinWaitActive("NetMotion Mobility XE Client Setup", "must know") Send("{Tab}") Send("domain address") Send("{TAB}") Send("{ENTER}") ; WinWait("NetMotion Mobility XE Client Setup", "not compatible") WinActivate("NetMotion Mobility XE Client Setup", "not compatible") WinWaitActive("NetMotion Mobility XE Client Setup", "not compatible") Send("!N") ; WinWait("Windows Security", "Would you like to install") WinActivate("Windows Security", "Would you like to install") WinWaitActive("Windows Security", "Would you like to install") Send("!A") Send("!I") ; WinWait("NetMotion Mobility XE Client Setup", "Click the Finish") WinActivate("NetMotion Mobility XE Client Setup", "Click the Finish") WinWaitActive("NetMotion Mobility XE Client Setup", "Click the Finish") Send("!F") ; WinWait("NetMotion Mobility XE Client Setup", "must restart") WinActivate("NetMotion Mobility XE Client Setup", "must restart") WinWaitActive("NetMotion Mobility XE Client Setup", "must restart") Send("!N") ; ProcessWaitClose($pid)EndIfPass /i to msiexec to invoke an install. Edit: I guess the security prompt you get is a unsigned driver install? You may need to change a Windows setting to allow that.
  21. So these are Windows XP 32bit registry entries with the Program Files path modified and then imported as 64bit registry entries? 32bit processes will look in the 32bit region of the registry. In my testing, some of those entries do not exist in the 32bit region when searched after the registry file import. The Software\Classes\Interface entries were missing. The Software\Classes\CLSID key is conditional with certain entries as mentioned here. I did try changing the Program Files ommitting the (x86) part and imported the reg file with the 32bit version of Regedit and I did find the entries that i could not find before. So perhaps you could try this concept and test if the internet games work with the changes.
  22. Hi rickendo, XP x64 is v5.2 as mentioned here. Perhaps this recent topic here about getting Windows versions may also help since your 1st post mentions many OSes.
  23. Note that GDI is graphics related which could be a clue. I had some problems with nVidia drivers late december. I was getting system freezing from nvlddmkm with id 14 in the event log. I noted the bad drivers to a txt file. 314.22 OK320.18 Issue331.82 Issue332.21 Current running on which are OKSo that may help you try versions that gave me no issues. I have not tried the latest nVidia drivers yet to know whether a issue exists with them and not sure from the bad experience if I want to update yet when things are working well. I have 2x GeForce GTX 560 Ti graphic cards on the PC.
  24. This is what I suspect with the script coming to a halt. This part (program ends after this)IF /i %AVG% == Y (can leave %AVG% unprotected i.e. %AVG% could be a space as jaclaz warned in post #7. So the line evaluated by the interpreter could become (program ends after this)IF /i == Y (which would generate a syntax error. The comparison becomes invalid if %AVG% is interpreted to being nothing or some other reason that cause it to fail. To know for sure, run the script from an already open administrator command prompt and repeat input you did to cause the failure. Redirect the stderr stream from the command to a file like below... Installscript.cmd 2> stderr.txtstderr.txt will contain the error output if a syntax error occured. You can skip the redirection if you like as the already open prompt should show the error as it will stay open after the error. Also note that you are choosing the option to install Libre Office if MS Office is installed. This condition is opposite to your previous code.
  25. My idea of an improvement is to ask the questions at the very start of the script so you do not need to wait for installs to be done before waiting for the next prompt to happen. This shows an example of how it can be done. @echo offecho Choose optional installs by typing Y for Yes or N for Noset AVG=Nset /p AVG="AVG ? "set LIBRE=Nif exist "%PROGRAMFILES%\Microsoft Office\" ( set LIBRE=MS_OFFICE_EXISTS) else ( set /p LIBRE="Libre Office ? ")echo Thankyou! Starting installations nowecho Installing Firefoxffox29.exe -msecho Installing Ashampooashampoo.exe /sp- /verysilent /norestartecho Installing C-Cleanerccsetup.exe /Secho Installing K-liteklite.exe /verysilent /norestartecho Adding Reg Key for No AutorunNOAUTORUN.regecho Installing Adobe Readeradobe11.exe /sPB /sAll /msi /norestart ALLUSERS=1 EULA_ACCEPT=YESecho Installing Adobe Reader UpdateAdbeRdrUpd11006_MUI.msp /qp /norestartif not exist "C:\Users\" ( echo Installing Internet Explorer 8 IE8-WindowsXP-x86-ENU.exe /passive /update-no /no-default /norestart) else ( echo Internet Explorer 8 Not Required)if /i "%AVG%" == "Y" ( if %PROCESSOR_ARCHITECTURE% EQU x64 ( echo Installing AVG x64 avgx64 /UILevel=silent /InstallToolbar=0 /ChangeBrowserSearchProvider=0 /SelectedLanguage=1033 /InstallSidebar=0 /ParticipateProductImprovement=0 /DontRestart /KillProcessesIfNeeded ) else ( echo Installing AVG x86 avgx86 /UILevel=silent /InstallToolbar=0 /ChangeBrowserSearchProvider=0 /SelectedLanguage=1033 /InstallSidebar=0 /ParticipateProductImprovement=0 /DontRestart /KillProcessesIfNeeded )) else ( echo AVG Installation Skipped)if "%LIBRE%" == "MS_OFFICE_EXISTS" ( echo Microsoft Office Detected!) else if /i "%LIBRE%" == "Y" ( echo Installing Libre Office LibreOffice_4.2.3_Win_x86.msi ALLUSERS=1 /q /norestart) else ( echo Libre Office Installation Skipped)echo Renaming Icons...ren "%USERPROFILE%\Desktop\CCleaner.lnk" "Run Weekly.lnk"ren "%USERPROFILE%\Desktop\Mozilla Firefox.lnk" "Internet.lnk"echo Renaming Doneif exists "C:\users\" ( echo Disabling Hibernation cmd.exe /c powercfg.exe -h off)echo Disabling System Restorereg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore" /v DisableSR /t REG_DWORD /d 1 /fsc config srservice start= disablednet stop srserviceecho Deleting Files del ffox29.exe del ccsetup.exe del adobe11.exe del klite.exe del IE8-WindowsXP-x86-ENU.exe del NOAUTORUN.reg del Install V1.1.bat del ashampoo.exe del avgx64.exe del avgx86.exe del LibreOffice_4.2.3_Win_x86.msi del AdbeRdrUpd11006_MUI.mspecho Operation Completeexit /b
×
×
  • Create New...