我正在尝试自动执行一个loadstate作业,为此,我需要能够从具有映射到旧计算机名的新计算机名列表的文本文件中进行读取。因此,Scanstate将用户状态配置文件导出到网络文件夹,该文件夹使用%Computername%变量为扫描的每台计算机创建一个文件夹。我们的想法是有一个与NewComputerA=OldComputerA,NewComputerB=OldComputerB匹配的文本文件,这样loadstate就会自动选择usmt.mig文件,我们只需要在文本文件上创建映射。这有意义吗?这是可行的吗?
可能是这样的:
If %Computername% == "NewComputerA" set %MigComputer% == "OldComputerA"
cd %Systemdrive%\usmt
"%CD%\Loadstate.exe" \\Server\user_states\%MigComputer%\usmt.mig /c /i:miguser.xml /i:migapp.xml /i:Network.xml /v:13语法可能并不完全正确,因为我是在路上学习的,但你知道我在这里试图做什么了……有什么建议或建议吗?
谢谢
发布于 2019-10-31 02:42:24
Computers.txt:
NewComputerA=OldComputerA
NewLaptopB=OldDesktopB批处理脚本:
set "NewName="
for /f "tokens=2 delims==" %%a in ('type Computers.txt ^| findstr /bi "%Computername%="') do set "OldName=%%a"
if not defined OldName echo No match. & goto :eof
"%Systemdrive%\usmt\Loadstate.exe" \\Server\user_states\%OldName%\usmt.mig /c /i:miguser.xml /i:migapp.xml /i:Network.xml /v:13Any advice or recommondations?为SS64添加书签并经常访问它。
https://stackoverflow.com/questions/58631196
复制相似问题