主要目的实现:用批处理添加关机前批处理脚本
由于每台电脑的sid不一样,想用批处理调出本机的UID然后替换1.reg内字符“电脑”
UID即是[HKEY_USERS\S-1-5-21-527237240-1767777339-682003330-500]
红色所示部分值
替换1.reg内所有的“电脑”字样,,然后运行1.reg不提示添加进注册表内
已知能查出电脑SID的批处理如下:- for /f "delims=" %%a in ('wmic userAccount where "Name='%userName%'" get SID /value') do call set %%a >nul
- echo %sid%
复制代码 下面两位答案均不能实现,谢谢他们
干脆把1.reg内容列出来吧- Windows Registry Editor Version 5.00
-
- [HKEY_USERS\电脑\Software\Policies\Microsoft\Windows\System\Scripts]
-
- [HKEY_USERS\电脑\Software\Policies\Microsoft\Windows\System\Scripts\Logoff]
-
- [HKEY_USERS\电脑\Software\Policies\Microsoft\Windows\System\Scripts\Logoff\0]
- "GPO-ID"="LocalGPO"
- "SOM-ID"="Local"
- "FileSysPath"="C:\\WINDOWS\\System32\\GroupPolicy\\User"
- "DisplayName"="Local Group Policy"
- "GPOName"="Local Group Policy"
-
- [HKEY_USERS\电脑\Software\Policies\Microsoft\Windows\System\Scripts\Logoff\0\0]
- "Script"="D:\\Program Files\\Tencent\\QQ\\Bin\\QQ.bat"
- "Parameters"=""
- "ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
-
- [HKEY_USERS\电脑\Software\Policies\Microsoft\Windows\System\Scripts\Logon]
复制代码
|