I download a file.
Then I want to change the filename to filename without dots
.S00E00.mkv,.avi or .mp4.
The filename is everything before .S00
Everything after E00 I do not want except extention.
Send this file to an external HD with folder name = filename and subfolder with S00 name
Is this possible?
Without actually getting what the filename really looks like and what it should be in the end I’d say - Yes, it is possible.
But why would you like to do it for one file with PowerShell? And if you really want to do it in PowerShell - what have you tried so far? Are you aware that there are tools available for file rename jobs like PowerToys PowerRename?
Please keep in mind this forum is for scripting questions rather than script requests. We do not write customized and ready to use scripts or solutions on request.
We expect you to make an own attempt to get your task done or to solve your problem. If you have done so already please document here what exactly you have done and show your code. Then we probably might be able to help you step further.
Yes I have tried PowerRename and like it!
This is how far I have gone
$files = Get-ChildItem -Path /Users/curt-ingehenning/Downloads/_KLARA
foreach ($file in $files)
{
$newFileName=$file.Name.Replace(“.”," ")
Rename-Item $file $newFileName
}
OK, I assume it is about more than one file, isn’t it?
Before we proceed: When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.
Again … please … when you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.
A new directory and subdirectory was created but the file was untouched original! Maybe the brackets in the filename caused it. Can be strange letters in original filename like ( ) , .
Can I change the destination to an external HD like G:/_TEST ?
Continues trying to compile this ps1 file to an exe.file and get this error message.
Spelling is correct.
Both Invoke-ps2exe and ReplaceTEST.ps1 is on desktop.
Invoke-ps2exe : The term 'Invoke-ps2exe' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and
try again.
At line:1 char:1
+ Invoke-ps2exe -inputFile 'C:\Users\ingew\Desktop\ReplaceTPB.ps1' -out ...
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Invoke-ps2exe:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundExceptiontype or paste code here