Introduction: The unit I work for is responsible for developing tax filing software. During the upgrade process (mainly in the form of downloading patches, using WINRAR self-extracting format), it often happens that customers operate it themselves and the upgrade fails!! (All the ABC directories are hypothetical; in reality it is the RIGHTIUM directory)
For example: our software is installed by default in the C:\ABC directory, but all files are placed in C:\ABC\123456( (each enterprise has its own six-digit enterprise code), while the default installation directory of the self-extracting file is C:\ABC. Because each enterprise code is different, the user needs to manually add \123456 (that enterprise's own enterprise code) after C:\ABC, but quite a lot of users just click install without adding \123456 (that enterprise's own enterprise code), and in the end the upgrade fails!!!
How do I write such a batch file!!!! (It must work in both WIN98 and WIN2000)
1. First automatically search every partition on the hard disk for the ABC directory (considering that some users may change the default installation directory);
2. Then search all directories under this directory that are named with six-digit numbers (enterprise codes) (because some accountants work part-time and may install several enterprises);
3. Then list the directories named with the found six-digit numbers (enterprise codes), and let the user choose which enterprise code to patch!!!
Note: 1. The patch file can be made into a self-extracting format, and then used together with a batch file!!!
2. Or could some teacher explain how to use one of the currently popular installers to directly search the registry, then list the directories found that are named with six-digit numbers (enterprise codes), and let the user choose which enterprise code to patch!!!
====================================================
At present I have made a batch file together with WBAT (not finished yet), but I have a few questions:
1. How can I make the JBSB and BAK directories under the ABC directory not appear in the list (have the batch file judge automatically)
2. How can I make it automatically extract to the selected code directory after clicking the required enterprise code!
3. Can the dready file be omitted, and use DIR directly!
Note: The above operations are all used under WIN98 and WIN2000, not under DOS. Everyone is welcome to make suggestions!
Below is my unfinished batch file. Please give me some guidance, brothers! Thanks again!
For example: our software is installed by default in the C:\ABC directory, but all files are placed in C:\ABC\123456( (each enterprise has its own six-digit enterprise code), while the default installation directory of the self-extracting file is C:\ABC. Because each enterprise code is different, the user needs to manually add \123456 (that enterprise's own enterprise code) after C:\ABC, but quite a lot of users just click install without adding \123456 (that enterprise's own enterprise code), and in the end the upgrade fails!!!
How do I write such a batch file!!!! (It must work in both WIN98 and WIN2000)
1. First automatically search every partition on the hard disk for the ABC directory (considering that some users may change the default installation directory);
2. Then search all directories under this directory that are named with six-digit numbers (enterprise codes) (because some accountants work part-time and may install several enterprises);
3. Then list the directories named with the found six-digit numbers (enterprise codes), and let the user choose which enterprise code to patch!!!
Note: 1. The patch file can be made into a self-extracting format, and then used together with a batch file!!!
2. Or could some teacher explain how to use one of the currently popular installers to directly search the registry, then list the directories found that are named with six-digit numbers (enterprise codes), and let the user choose which enterprise code to patch!!!
====================================================
At present I have made a batch file together with WBAT (not finished yet), but I have a few questions:
1. How can I make the JBSB and BAK directories under the ABC directory not appear in the list (have the batch file judge automatically)
2. How can I make it automatically extract to the selected code directory after clicking the required enterprise code!
3. Can the dready file be omitted, and use DIR directly!
Note: The above operations are all used under WIN98 and WIN2000, not under DOS. Everyone is welcome to make suggestions!
Below is my unfinished batch file. Please give me some guidance, brothers! Thanks again!





