CONTEST for SHORT Code snippet for DOS shell Windows batch SCRIPT short simple to understand or oneliner

  • 状态: Closed
  • 奖金: $20
  • 参赛作品已收到: 3
  • 获胜者: dany3j

竞赛简介

This is a CONTEST for a CODE SNIPPET for WINDOWS 10 command line DOS batch shell oneliner/script.

I have a file called FULLPATHS.txt with content:

/blabla/bla/importantUniqueNameHere/package.exe
/blablablabla/blahaha/importantUniqueNameHere/package.exe
/blapath/blapath/importantUniqueNameHere/package.exe
...

Basically the 3rd field/directory-name is AWAYS the UNIQUE name that I want to download/save file as.

You must IMPROVE the line below or replace with something different/better:

for /F %i in (FULLPATHS.txt) do (Download.exe %i )

The above line will DOWNLOAD those "package.exe" files into the current directory, but of course since they all end in package.exe , they OVERWRITE and you end up with just ONE file.

You must provide BETTER SOLUTION which saves with FILENAME as the "importantUniqueNameHere".exe

You can use nested for loops, you can use setlocal delayedexpansion , tokens etc or you can combine dos shell with windows perl or with GNU awk/gawk for windows. You can even provide a PowerShell solution.

Be CREATIVE but BEST WINNING SOLUTION will be the SIMPLEST easiest to understand, so that the methods can be re-used easily in future. I prefer short oneliners over full blow "scripts". Short fast and simple is best :)

I look forward to seeing your creative solutions!
Thanks!

您还可能感兴趣的技能

雇主反馈

“Daniel is great, he was first to post the best working solution!”

个人主页照片 jvirt, United States.

公共说明面板

还没有信息。

如何以竞赛开始

  • 发布您的竞赛

    发起您的竞赛 快速简单

  • 获取众多参赛作品

    获取大量参赛作品 来自世界各地

  • 悬赏最佳参赛作品

    悬赏最佳参赛作品 下载文件-简单!

立即发布竞赛 或者立即加入我们!