Off topic renaming help.
- This topic is empty.
-
AuthorPosts
-
May 3, 2015 at 4:06 pm #444470
Try this:
For ($i = 1; $i -le 3; $i++) {
$filesArray = Get-ChildItem -Path "F:scripttest" -Recurse | Where {$_.Name -Match "[^u0020-u007F]"}
$filesArray | ForEach-Object {
$newFileName = [Text.Encoding]::ASCII.GetString([Text.Encoding]::GetEncoding("Shift-JIS").GetBytes($_.Name))
$newFileName = $newFileName.Replace('?','_').Replace('','_')
If ($_.Name -ne $newFileName) {
$increm = 1
$testName = $_.FullName.Replace($_.Name,$newFileName)
While (Test-Path -LiteralPath $testName)
{
$nextName = ([iO.FileInfo]$newFileName).BaseName + "_($num)" + ([iO.FileInfo]$newFileName).Extension
$testName = $_.FullName.Replace($_.Name,$nextName)
$num += 1
}
Move-Item -LiteralPath $_.FullName -Destination $testName
Write-Host $_.Name
Write-Host $newFileName
}
}
}I didn’t try to get it to do folders first and files second – I just made it loop the function three times so it should get folders, then any files/folders in the first folder, then any files/folders in the second folder. I don’t know if it’ll break compatibility with the game. It’s also going to give you a bunch of gibberish filenames, e.g.
_`_D_h_D____________ – _R___s___[_^_[____________
_A_____J – STAR TREK
_A___p___}__ – _A___p___}_____}_[_`
_C_C_g__ – _E_L_E_LWATCHING
I hate to use -LiteralPath instead of Path because sometimes the renamed path would have characters PowerShell uses as escape characters (e.g. `), and I had to use Move-Item instead of ren or Rename-Item because Move-Item takes -LiteralPath and Rename-Item does not.
” src=”/wp-content/uploads/invision_emoticons/default_SA_wink.gif”>May 3, 2015 at 7:57 pm #444491So I’ve been stumped on something for a little while, and I figured it couldn’t hurt to ask here.Have we heard of Pop’nMusic? Stepmania? Maybe? Cool.
I saw StepMania and I got excited. Didn’t know anyone else actually played it besides me, ha ha.
Yeah. I’ve been playing stepmania on and off for like 10 years. It’s relaxing. I’m making a song at the moment.
That’s awesome! Same here, played it on and off for around 10 years. You have a pad hooked up to it or do you just play with the keyboard?
May 4, 2015 at 5:11 pm #444567May 5, 2015 at 12:51 am #444642That’s a pretty nice looking pad. I got mine from DDRgame (http://www.ddrgame.com/dance-dance-revolution-ps-tournament.html). I haven’t been able to use it as often as I like but it’s better than the old soft pads I used when I first started!
-
AuthorPosts
- You must be logged in to reply to this topic.