在一个文件夹中运行所有.exe



我在VM中玩恶意软件,我尝试的每个脚本都卡住了。基本上,我需要在一个文件夹中运行每个。exe。尝试使用start, powershell等批处理文件。当AV将一些文件移动到quarentine,或者一些进程继续运行时,脚本不会跳转到下一个,就会发生这个问题。

CMD开始工作,但没有找到一些文件时显示弹出窗口,然后你必须不断点击跳转到下一个文件。

这些工作,但卡住了一段时间后:

Get-ChildItem 'C:UsersLABDesktoptest' | ForEach-Object {
>>   & $_.FullName
>> }

相同:

for %%v in ("C:UsersLABDesktoptest*.exe") do start "" "%%~v"

:

for %%i in (C:UsersLABDesktoptest*.exe) do %%i

您需要提供某种形式的代码,以便我们帮助您排除故障;这不是请求一个脚本页面。

无论如何,你会看到这样的东西:

#Assuming the .exe's are located in C Root.
Get-ChildItem -Path C: | Where-Object {$_.Extension -like ".exe"}| Foreach {Start-Process $_.FullName}
#In Ps, we like to filter as far left as possible for faster results.
Get-ChildItem -Path C: -File "*.exe" | Foreach {Start-Process $_.FullName}
#Running the commands as jobs so it doesnt wait on any to finish before running the next.
Start-Job { Get-ChildItem -Path C: -File "*.exe" | Foreach {Start-Process $_.FullName} }
Start-Sleep 2
Get-Job | Remove-Job

请参考以下链接:如何提问

最新更新