Author Topic: Code improvement for WR  (Read 11316 times)

0 Members and 1 Guest are viewing this topic.

Offline Willy2

  • Hero Member
  • *****
  • Join Date: Oct 2011
  • Posts: 1165
  • Karma: 18
    • View Profile
Code improvement for WR
« on: November 18, 2021, 07:42:22 pm »
I have a proposal to "Clean up" the program code in Windows Repair (WR). WR runs a number of MSDOS command in several repairs and those commands can "cleaned up". Inside WR one can find a sequence of commands something like this (in bold & italics):

REM register an number of files in the "System32" folder:

regsvr32.exe   file.dll /s
regsvr32.exe   file2.dll /s
regsvr32.exe   file3.dll /s

REM test if a computer is a 32 bit or 64 bit system

IF NOT EXIST "C:\windows\syswow64\regsvr32.exe  goto nextcode

REM register a files number of files in the "Syswow64" folder
REM target the "Syswow64" folder.

regsvr32.exe  file.dll /s
regsvr32.exe  file2.dll /s
regsvr32.exe  file3.dll /s

.nextcode



This piece of code contains a "goto" command and that's NOT recommended.

The lines that target the "Syswow64" folder can be improved/cleaned up. Those lines in WR can replace that with slightly different code that also would target the "Syswow64" folder. Instead of using "goto" WR can use a slightly different "IF" code and NO "goto".

Then the lines that target the "syswow64" folder (see the example above) would become something like this (in bold italics):

REM test if a computer is a 32 bit or 64 bit system

IF EXIST "C:\windows\syswow64\regsvr32.exe  (

REM register a files number of files in the "Syswow64" folder
regsvr32.exe  file.dll /s
regsvr32.exe  file2.dll /s
regsvr32.exe  file3.dll /s
)
« Last Edit: November 19, 2021, 05:48:30 pm by Willy2 »

Offline Boggin

  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Jul 2014
  • Posts: 10182
  • Location: UK
  • Karma: 122
    • View Profile
Re: Code improvement for WR
« Reply #1 on: November 19, 2021, 04:42:30 am »
I've emailed Shane with a link to your thread for his consideration.