如何使用txt文件在批处理脚本中填充变量然后循环遍历以将文本文件中的所有名称用作变量,直到用尽为止

问题描述

这是我用来将用户名提取到文本文件中的代码。我想将该文件用作输入。我似乎不知道该怎么做。

此示例中的工具来自:https://ericzimmerman.github.io/#!index.mdhttps://f001.backblazeb2.com/file/EricZimmermanTools/JLECmd.zip,以及 https://f001.backblazeb2.com/file/EricZimmermanTools/ShellBagsExplorer.zip

到目前为止,我拥有的实际代码。文件users.bat InputDrive OutputDrive Systemname "Username from text file"这样运行。

@echo off
title Users.bat %1 %2 %3 %4  
cls
echo This batch file will dump shellbags.
rem start cmd.exe /A /k "CD /D %1:\Users"  
CD /D %1:\Users 
for /d %%D in (*) do echo %%~nxD >> %2:/Users.txt 
cd /D C:\CommandPost\Kit-Analysis
C:\Test-Kit\ShellBagsExplorer\SBECmd.exe -d "%1:\Users\%4\AppData\Local\Microsoft\Windows" --csv "%2:\Results-Analysis\%3\Users\%4\ShellBags"
C:\Test-Kit\JLECmd\JLECmd.exe -d "%1:\Users\%4\AppData\Roaming\Microsoft\Windows\Recent" --csv "%2:\Results-Analysis\%3\Users\%4\JumpList" --html "%2:\Results-Analysis\%3\Users\%4\JumpList-Html"
echo Finished

任何帮助将不胜感激。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)