![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-09 02:11 |
47,811 topics / 349,895 posts / today 0 new / 48,253 members |
| DOS批处理 & 脚本技术(批处理室) » Batch script to modify computer name\workgroup\description\IP\mask\gateway\DNS |
| Printable Version 2,747 / 6 |
| Floor1 exzzz | Posted 2008-02-01 15:50 |
| 初级用户 Posts 167 Credits 194 | |
|
Please help, I wrote it too complicated, and I don't know how to make some parts simpler. Please give me some advice, thank you!!
Known areas for improvement: When querying local information, it can be integrated into a sub-function for calling, but because I don't know how to call the code embedded in the bat, I had to copy it once. 1. Program purpose: Our company does operation and maintenance for China Mobile, and there are always endless systems to install, but they are roughly divided into several types, and it is necessary to set IP, naming, etc. of computers according to certain rules. 2. Computer parameter setting rules: Computer IP: The service hall internal network starts with 192, the last digit is different according to different purposes, and other aspects of IP settings are the same. The service hall business machine uses an IP starting with 10, and the gateway is different Workgroup rules: Set according to the full pinyin of the service hall, for example, JINGTIAN Computer naming rule: Service hall abbreviation + last digit of IP + business use, for example, JT-149YW Computer description rule: Jingtian service hall Business 2 3. Batch processing architecture Main program: Modify local parameters.bat Achieve the function of querying and modifying the following content IP, mask, gateway, DNS, computer name, workgroup, computer description, Call subroutine: loadini.bat Achieve the function of reading the preset parameters of the.ini configuration file Additional program: Generate template.bat Use the local configuration to generate a general configuration file. It is convenient to call directly on other machines without manually modifying the template file. The following is the program content ★★★★★★★★★★★★★★★★★★★★★★★★★ Modify local parameters.bat loadini.bat ★★★★★★★★★★★★★★★★★★★★★★★★★ ★★★★★★★★★★★★★★★★★★★★★★★★★ Generate template.bat ★★★★★★★★★★★★★★★★★★★★★★★★★ Service Hall CFG.INI ★★★★★★★★★★★★★★★★★★★★★★★★★ 192cfg.ini ★★★★★★★★★★★★★★★★★★★★★★★★★ 10cfg.ini ───────────────── Moderation Record ───────────────── Performed: HAT Operation: Added code tags to the code ───────────────── Moderation Record ───────────────── [ Last edited by HAT on 2008-12-5 at 20:13 ] |
|
| Floor2 exzzz | Posted 2008-02-01 15:53 |
| 初级用户 Posts 167 Credits 194 | |
|
If any friend has just started to get in touch with batch processing and wants to ask about some of its grammars, you are welcome to ask questions, and I will do my best to answer. Also, please leave an email, because I may not be free to surf the Internet often. Thank you!
|
|
| Floor3 catms | Posted 2008-06-02 14:13 |
| 新手上路 Posts 6 Credits 12 | |
|
A bit...
Too... Powerful I used the IP - changing script circulating on the network Sweat... |
|
| Floor4 pusofalse | Posted 2008-06-02 14:17 |
| 银牌会员 Posts 646 Credits 1,604 | |
|
It feels a bit complicated script~
|
|
| Floor5 exzzz | Posted 2008-12-05 17:17 |
| 初级用户 Posts 167 Credits 194 | |
|
I didn't come online for a long time because the forum seemed to be unavailable some time ago.
Today, I received an email from a net friend asking about several commands in this batch script. After replying to the email and coming back to take a look, I was even awarded points. That made me very happy, heh heh. |
|
| Floor6 ktv98 | Posted 2008-12-05 21:16 |
| 初级用户 Posts 81 Credits 112 | |
|
Learning
|
|
| Floor7 jia332 | Posted 2008-12-11 10:36 |
| 初级用户 Posts 81 Credits 160 | |
|
Feels great, push it up for everyone to share
|
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |