更多的wmic用法示例(二)
2010-09-01 16:44
591 查看
更多的wmic用法示例(二)
2008-10-28 13:28
2008-10-28 13:28
删除c:/good文件夹 wmic fsdir where(name='c://good') delete wmic fsdir where(name='c://good') call delete 重命名c:/good文件夹为abb wmic fsdir where(name='c://good') rename "c:/abb" 复制文件夹 wmic fsdir where(name='d://test') call copy "c:/ppcd" wmic nicconfig where(index='8′) call enablestatic "192.168.1.81″,"255.255.255.0″ 设置IP地址和子网掩码 wmic nicconfig where(index='8′) call setgateways "192.168.0.1″,1 设置网关和跃点数 wmic nicconfig where(index='8′) call setdnsdomain ("192.168.0.1″,"192.168.0.11″) 设置DNS服务器地址,设置完毕后不会马上生效,必需要设置主次才可以生效 wmic nicconfig where(index='8′) call SetDNSServerSearchOrder ("192.168.0.1″,"192.168.0.11″) 设置DNS服务器地址的主次顺序,192.168.0.1在前表示为首选DNS地址,在后为备用DNS地址 wmic path Win32_NetworkAdapterConfiguration.index=8 call enabledhcp WMIC默认的NICCONFIG别名是不提供enabledhcp这个方法的,所以我们只能调用他的WMI函数来设置动态分配IP地址的设置 wmic nicconfig where(index='8′) get /value INDEX值为你当前网卡的索引值,每台机器都不一样 job 计划任务 wmic job call create "sol.exe",0,0,1,0,********154600.000000+480 WMIC设置系统时间 wmic os where(primary=1) call setdatetime 20070731144642.555555+480 WMIC对注册表的操作 wmic /namespace://root/default path stdregprov call getstringvalue ^&H80000002,"SOFTWARE/libowen","hello" wmic /namespace://root/default path stdregprov call createkey ^&h80000001,"libowen/good" wmic /namespace://root/default path stdregprov call deletekey ^&h80000001,"libowen/sdd" wmic /namespace://root/default path stdregprov call EnumKey ^&h80000001,"Keyboard Layout" wmic /namespace://root/default path stdregprov call Enumvalues ^&h80000001,"Keyboard Layout/preload" wmic /namespace://root/default path stdregprov call SetStringValue ^&h80000001,"libowen/test","hello world!","test" wmic /namespace://root/default path stdregprov call SetStringValue ^&h80000001,"libowen/test","test","aabb" wmic pagefileset get /value 用来察看本地计算机虚拟内存情况,初始大小,最大值,保存位置等 下面我们可以改变虚拟内存文件(也就是我们常说的页面文件) 所在位置以及初始大小和最大值 wmic pagefileset set initialsize=512,maximumsize=1024 这个只是改变初始大小和最大值,SET不能修改页面文件所存放的位置,也就是说默认页面文件在C盘这时不能把他的位置修改到D盘,如果要修改到D盘我们可以这样来做 wmic pagefileset create name='d:/pagefile.sys',initialsize=512,maximumsize=1024 然后删除以前的就可以了,请看 wmic pagefileset where(name='c://pagefile.sys') delete 这样就实现了把页面文件转移到D盘的效果 WMIC 设置共享 建立共享文件夹 WMIC SHARE CALL Create "","test","3″,"TestShareName","","c:/test",0 删除共享文件夹 C:/>WMIC SHARE where(path='c://test') delete Type (共享类型) Type of resource being shared. Types include: disk drives, print queues, interprocess communications (IPC), and general devices. Value Meaning 0—–Disk Drive 1—–Print Queue 2—–Device 3—–IPC 2147483648—-Disk Drive Admin 2147483649—-Print Queue Admin 2147483650—-Device Admin 2147483651—-IPC Admin Useraccount 别名 C:/>wmic useraccount where(LocalAccount='1′ and name='good') set disabled=true C:/>wmic useraccount where(LocalAccount='1′ and name='good') set fullname="hello world!" C:/>wmic useraccount where(localaccount=true and name='good') set passwordchangeable=true C:/>wmic useraccount Where "domain='ql-libowen' and name='libowen'" set PasswordExpires=false wmic修改所有基础网络设置 @echo off ::网络设置声明 set ipas=192.168.0 set dns1=61.144.56.100 set dns2=202.96.128.68 set mask=255.255.255.0 set gateway=192.168.0.1 set group=APPLE :input set /p varuser=input(num1-99): if "%varuser%" == "install" goto inst set /a 1/(99/varuser)||goto input if "%varuser%" == "%gateway:~-1%" set varuser=254 ::IP地址修改 wmic nicconfig where IPEnabled=true call enablestatic ("%ipas%.%varuser%"),("%mask%") ::gateway wmic nicconfig where IPEnabled=true call setgateways ("%gateway%") ::DNS修改 wmic nicconfig where IPEnabled=TRUE call SetDNSServerSearchOrder ("%dns1%","%dns2%") ::WORKGROUP wmic computersystem where domain!=" " call JoinDomainOrWorkgroup "","","%group%" set /a 1/(varuser/10)||set varuser=0%varuser% ::computer name wmic computersystem where name="%COMPUTERNAME%" call rename user%varuser% ::更改SAP网络号 wmic nicconfig call SetIPXVirtualNetworkNumber 000000%varuser% |
相关文章推荐
- wmic用法示例
- underscore用法,完整示例,喜欢就点赞加关注,以后会有更多惊喜
- heat 用法 示例
- jQuery中$.fn的用法示例介绍
- jQuery包裹节点用法完整示例
- MongoDB的MapReduce用法及php示例代码
- STL学习之六:queue用法示例
- Java抽象类用法示例详解
- Jquery+php+mysql实现上拉加载更多,后端CI,超详细,有示例(其实就是ajax无刷新分页)
- C语言指针详解及用法示例
- C++模板用法:定义、使用 示例
- ThinkPHP模板Switch标签用法示例
- Inherited用法代码示例
- 倒影view和surfaceView的示例用法
- this用法的简单示例
- Django返回json数据用法示例
- [导入]AjaxPanel自定义控件实现页面无刷新数据交互(做了个示例程序, 效果确实比较Cool, 用法非常简单! )(示例代码下载)
- jQuery hover()的用法示例
- ajax用法示例
- jQuery Validation用法示例