Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Define the directory path and the text prefix
- $directoryPath = "C:\GAMEZ\Red Dead Redemption 2\lml\UpscaledAnimals\Birds\Birds" # Change this to a directory path of the mod folder that contains only files of the same .rpf
- $prefix = "C:\GAMEZ\Red Dead Redemption 2\packs_0.rpf\packs\base\models\metaped_textures_animals.rpf\" # Change this to the .rpf path (remember to delete the .ytd part if you're copying the path from a file)
- # Check if the directory exists
- if (!(Test-Path -Path $directoryPath)) {
- Write-Host "The directory does not exist: $directoryPath"
- exit
- }
- # Check if the $prefix ends with a backslash and add one if necessary
- if (-not ($prefix.EndsWith("\"))) {
- $prefix += "\"
- }
- # Initialize the list to hold the modified file names
- $fileList = @()
- # Get all files in the specified directory
- $files = Get-ChildItem -Path $directoryPath -File
- # Loop through each file and add the prefix
- foreach ($file in $files) {
- # Create the formatted entry with prefix
- # Ensure to use the file name instead of the file object
- $entry = "$prefix$file"
- $fileList += $entry
- }
- # Output the result to the console
- $fileList
- # Optionally, save the list to a text file
- $outputFilePath = ".\EasySource_paths.txt" # Change to absolute path
- $fileList | Out-File -FilePath $outputFilePath # Change this to your desired output path
Advertisement
Add Comment
Please, Sign In to add comment