▼ ▼ download the last version here ▼ ▼

 

Reset Windows Update Tool is a complete troubleshooting tool that can be generated with Windows updates.

This new stage opens the door for the implementation of new resources.

Since this tool was developed as a script for the Windows command console, it is possible to use a development language that allows the use of command line in a simple way as they allow languages ​​like C ++.

 The first phase of this development consists in inheriting the characteristics of its predecessor as the possibility to recognize the operating system, to confirm the use of administrator roles; and implement new functions such as the use of language files, configuration files, and others.

The first challenge is to find a communication channel between the command console and programming languages ​​like C ++.

Since each command executed through console can detonate an error, this information is stored in a system variable known as errorlevel and it gives us a specific error number. In case of no error, the value of errorlevel is equal to zero (0).

Taking advantage of this behavior we can open a communication channel between the Windows command console and our language as follows:

C++
Editar script|Remove
int errorlevel = system("openfiles>nul 2>&1");

Once this channel is defined, we can make use of the previous program commands.

In the case of recognition of operating systems presents an additional challenge since the way established in the original version determines the value of the version of the operating system through a non-numeric variable, ie, the value returned is not stored in the variable errorlevel, if not in a custom variable that can not be set on C ++.

This implies that it is necessary to find an alternative for the recognition of the operating system. Fortunately, there is a method that allows us to use the variable errorlevel for this purpose, even though its efficiency is lower.

Mode 1:

Windows Shell Script
Editar script|Remove
for /f "tokens=4 delims=[] " %%a in ('ver'do set version=%%a 
 
if %version%==6.2.9200 ( 
    set name=Microsoft Windows 8 
) else if %version%==6.3.9200 ( 
    set name=Microsoft Windows 8.1 
) else if %version%==6.3.9600 ( 
    set name=Microsoft Windows 8.1 Update 1 
) else if %version%==10.0.10240 ( 
    set name=Microsoft Windows 10 Threshold 1 
) else if %version% EQU 10.0.10586 (  
    set name=Microsoft Windows 10 Threshold 2  
) else if %version% EQU 10.0.14393 (  
    set name=Microsoft Windows 10 Redstone 1  
) else if %version% EQU 10.0.15063 (  
    set name=Microsoft Windows 10 Creators Update  
)

Mode 2:

Windows Shell Script
Editar script|Remove
ver | find "6.2.9200" > nul 
if %errorlevel% EQU 0 ( 
    set name=Microsoft Windows 8 
) 
 
ver | find "6.3.9200" > nul 
if %errorlevel% EQU 0 ( 
    set name=Microsoft Windows 8.1 
) 
 
ver | find "6.3.9600" > nul 
if %errorlevel% EQU 0 ( 
    set name=Microsoft Windows 8.1 Update 1 
) 
 
ver | find "10.0.10240" > nul 
if %errorlevel% EQU 0 ( 
    set name=Microsoft Windows 10 Threshold 1 
) 
 
ver | find "10.0.10586" > nul 
if %errorlevel% EQU 0 ( 
    set name=Microsoft Windows 10 Threshold 2 
) 
 
ver | find "10.0.14393" > nul 
if %errorlevel% EQU 0 ( 
    set name=Microsoft Windows 10 Redstone 1 
) 
 
ver | find "10.0.15063" > nul 
if %errorlevel% EQU 0 ( 
    set name=Microsoft Windows 10 Creators Update 
) 

The use of this method is translated in the following way (its application avoids the modification of the manifest file or the use of other libraries):

C++
Editar script|Remove
int errorlevel; 
 
errorlevel = system("ver | find \"6.2.9200\" > nul"); 
if (errorlevel==0) { 
    // Name: "Microsoft Windows 8". 
} 
 
errorlevel = system("ver | find \"6.3.9200\" > nul"); 
if (errorlevel==0) { 
    // Name: "Microsoft Windows 8.1". 
} 
 
errorlevel = system("ver | find \"6.3.9600\" > nul"); 
if (errorlevel==0) { 
    // Name: "Microsoft Windows 8.1 Update 1". 
} 
 
 
errorlevel = system("ver | find \"10.0.10240\" > nul"); 
if (errorlevel==0) { 
    // Name: "Microsoft Windows 10 Threshold 1". 
} 
 
 
errorlevel = system("ver | find \"10.0.10586\" > nul"); 
if (errorlevel==0) { 
    // Name: "Microsoft Windows 10 Threshold 2". 
} 
 
errorlevel = system("ver | find \"10.0.14393\" > nul"); 
if (errorlevel==0) { 
    // Name: "Microsoft Windows 10 Redstone 1". 
} 
 
errorlevel = system("ver | find \"10.0.15063\" > nul"); 
if (errorlevel==0) { 
    // Name: "Microsoft Windows 10 Creators Update" 
} 

The most effective way to implement the code of the tool is through the use of classes, for this reason a series of modules or headers (*.h) are defined.

A specific module is defined for the use of the command console:

C++
Editar script|Remove
#ifndef _Executer_ 
#define _Executer_ 
 
#include <iostream> 
#include <string> 
#include <windows.h> 
 
#include "explorer.h" 
 
using namespace std; 
 
/** 
 * Execute command-lines. 
 */ 
class Executer { 
 
    private: 
     
        // ----------------------------------------------------------------- 
        // Relations 
        // ----------------------------------------------------------------- 
        Explorer* explorer; 
     
    public: 
     
        /** 
         * Create a manager for the files. 
         */ 
        Executer() { 
            explorer = new Explorer(); 
        } 
         
        /** 
         * Launch a program or system property. 
         */ 
        void start(string pCommand) { 
            string cmd = "start " + pCommand; 
            system(cmd.c_str()); 
        } 
         
        /** 
         * Browse a link at Internet Explorer. 
         */ 
        void browser(string pLink) { 
            string cmd = "start iexplore.exe " + pLink; 
            system(cmd.c_str()); 
        } 
         
        /** 
         * Open a file in the directory. 
         */ 
        void open(string pPath, string pFile) { 
            string file = explorer->getPath() + pPath + pFile; 
             
            if(explorer->exist(file)) { 
                ShellExecute(NULL, "open", file.c_str(), NULL, NULL, SW_SHOWDEFAULT); 
            } 
        } 
 
}; 
 
#endif

  In the same way a module is defined for the handling of files: 

C++
Editar script|Remove
#ifndef _Explorer_ 
#define _Explorer_ 
 
#include <iostream> 
#include <string> 
#include <windows.h> 
 
using namespace std; 
 
/** 
 * Reader the files and directories. 
 */ 
class Explorer { 
 
    private: 
     
        // ----------------------------------------------------------------- 
        // Attributes 
        // ----------------------------------------------------------------- 
        string path; 
     
    public: 
     
        /** 
         * Get the current directory. 
         */ 
        string getPath() { 
            if(path == "") { 
                char result[MAX_PATH]; 
                  GetModuleFileName(NULL, result, MAX_PATH); 
                   
                  int pos = string(result).find_last_of("\\") + 1; 
                  path = string(result).substr(0, pos); 
            } 
             
            return path; 
        } 
         
        /** 
         * Check if a file exists. 
         */ 
        bool exist(string pFile) { 
            if (FILE *file = fopen(pFile.c_str(), "r")) { 
                fclose(file); 
                return true; 
            } 
             
            return false; 
        } 
 
}; 
 
#endif

For more details you can visit the page: http://wureset.com/