本帖最后由 ygqiang 于 2017-3-2 09:04 编辑
bat如何搜索并替换ini文件里的userx关键字。不能用第三方exe软件。
其中的x是数字,不确定位数、也不确定是哪个数字。
搜索userx关键字,然后替换成user%y%,y变量是手动输入的数字。
比如ini文件里面,这里的userx就是指user231
config.ini文件内容如下:- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.\VMware VDM\Client" /v EnableShade /t REG_SZ /d false /f
- reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v Shell /t REG_SZ /d wscript c:\\client\\start.vbs /f
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.\VMware VDM\Client" /v ServerURL /t REG_SZ /d vdi.aaa.bbb.cn /f
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.\VMware VDM\Client\Security" /v CertCheckMode /t REG_SZ /d 0 /f
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.\VMware VDM\Client" /v NonInteractive /t REG_SZ /d false /f
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.\VMware VDM\Client" /v DomainName /t REG_SZ /d CLOUD /f
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.\VMware VDM\Client" /v UserName /t REG_SZ /d user231 /f
-
- ccc
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.\VMware VDM\Client" /v Password /t REG_SZ /d ccc@123 /f
-
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.\VMware VDM\Client" /v DesktopLayout /t REG_SZ /d FullScreen /f
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.\VMware VDM\Client" /v connectUSBOnStartup /t REG_SZ /d true /f
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.\VMware VDM\Client" /v connectUSBOnInsert /t REG_SZ /d true /f
- reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v connectUSBOnInsert /t REG_SZ /d true /f
- reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v disablecad /t REG_DWORD /d 1 /f
- reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v DisableTaskMgr /t REG_DWORD /d 1 /f
- reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v legalnoticecaption /f
- reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v legalnoticetext /f
- shutdown -r -f -t 1
复制代码
|