FOR命令实用示例一:批量重命名域计算机名称的方法

| | Comments (0) | TrackBacks (0)

建立一个文本文件,里面包含新老计算机名 ex. name.txt
oldname1;newname1
oldname2;newname2
oldname3;newname3
oldname4;newname4

再用 For 命令+netdom 来做批量重命名
命令行下:
FOR /F "tokens=1,2* delims=;" %i IN (name.txt) DO netdom renamecomputer %i /newname:%j /userD:xxx\gop022 /passwordd:* /usero:admin /passwordo:* /reboot:1 /force

把 userD usero 以及相应的 password 换成你自己的环境
如果是用批处理,记得把 %i, %j 替换成 %%i,%%j

For 的具体用法请参见 windows 帮助文件

Categories

,

0 TrackBacks

Listed below are links to blogs that reference this entry: FOR命令实用示例一:批量重命名域计算机名称的方法.

TrackBack URL for this entry: /huiying.cgi/155.

Leave a comment

About this Entry

This page contains a single entry by pOweRK6 published on July 16, 2007 9:23 PM.

找工作啊找工作! was the previous entry in this blog.

叶永烈先生的《新版小灵通漫游未来》 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.2-en