Sort music files and go to the target folder

What goes wrong?

It doesn't seem to be picking up the track info on the files. I have checked and the files are tagged with ID3v2.3 tag format. I tried retagging so they also have ID#v1 as well
It doesn't seem to create the folder based on the artist and album name.
It creates a single file with no name on the first file and then the second file generates a renaming error: "Cannot create a file when that file already exists"

Also, I notepad text is generated and opened when the process completes: dop201912132119220083.bat

echo off
chcp 1252 > nul
D:
cd "\Downloads"
rmdir D:\Downloads\Gong_-_The_Universe_Also_Collapses_(2019)

Thanks

Just in case, here's the script I've used for years but I did just grab the one from the forums here, created a new button and get the same results

@noexpandenv
@runmode hide
@set OriginalSource={sourcepath$|noterm}
Rename FILEINFO FROM "*.mp3" TO "{alias|mymusic}\{mp3artist}\{mp3album}\{mp3track|#2} - {mp3title}.{ext}"
Go PATH ".." DUALPATH "%RENAME_TARGET%"
rmdir {$OriginalSource}
@script vbscript
Option Explicit
Dim fs
Set fs = CreateObject("Scripting.FileSystemObject")
Dim Shell
Set Shell = CreateObject("WScript.Shell")
Dim EnvVars
Set EnvVars = Shell.Environment("PROCESS")
Function Rename_GetNewName(strFileName, strFilePath, fIsFolder, strOldName, ByRef strNewName)
   ' Fix any double \ chars resulting from empty tags (e.g. no genre).
   ' If we don't do this, things can get confused about the destination path.
   strNewName = Replace(strNewName, "\\", "\")
   ' Set the %RENAME_TARGET% environment variable to the folder we're moving the file to.
   ' This can be used in the main command above to go to the folder.
   ' Note that we use "@noexpandenv" at the top of the command; if we didn't then %RENAME_TARGET%
   ' would be expanded *before* this script had run, which obviously would not work.
   EnvVars("RENAME_TARGET") = fs.GetParentFolderName(strNewName)
End Function

If you add the music track, artist, etc. columns to the file display, what does it show for that mp3 file?

Nothing shows up in those columns. Is it an issue with the tags? I know the files are tagged.

Most likely. Can you send me a sample file via private message? (Zip it first as the forum won't allow .mp3 attachments.)

Sent

Opus shows the music tags for that file OK here.

Have you disabled the AudioTags plugin (Preferences / Viewer / Plugins) or anything like that?

Plugin is enabled. I sent you a screenshot of that as well as the lister view showing no track info

In your screenshot, the Dimensions column is also turned on. If you copy a JPG image into that folder, do its dimensions appear?

If the column is also blank there, it's possible something is crashing or freezing the file-info thread, or making it take a long time. Manually generating process snapshots may allow us to tell you what's doing that, if so.

No Dimensions showed up and also the track info for files that were previously moved. I guess I need to figure out why it's not working for all mp3s

Leo,
I may try reinstalling and I'll have also play around with these files and see what's different.
Believe it or not the file I sent you now displays the info as you saw but the original does not. Not sure what's going on.

OK, it seems 7-zip is causing the issue. If I unzip using windows "extract all" everything's fine. If I use 7-Zip to unzip I do not get any track info. So I think the issue lies there.
I also do not seem to have access to Dopus internal zip functions.
Doesn't matter if I have them enabled or not.

Thanks for the help!

That sounds like maybe Opus is running under a Windows account / context that doesn't have permission to read the files in that folder.

Windows 10. My account is a local admin account.
I tried shutting down Dopus completely and restarted with "Run as Administrator" with no change.
I will uninstall 7-zip and try a reinstall of Dopus to see if anything changes but at least we figured out the original issue.

Thanks.

It could also be something else is holding locks on the files (maybe an indexing service gone wrong?), or maybe antivirus is blocking access for some reason.

Process Monitor might be able to report what happens when Opus attempts to open the files.

OK, Uninstalled 7-zip and found the archive settings for Dopus to put the context menu items back. All that is working fine. I'm left with one issue in the script that you can probably help me clear up.

It's not deleting the original folder and there's definitely nothing in it after the script is run and the script always seems to create and open a .bat text file

example:
@echo off
chcp 1252 > nul
D:
cd "\Downloads\New Music"
rmdir "D:\Downloads\New Music\Gong_-The_Universe_Also_Collapses(2019)"

I'm guessing this is because it's not removing the directory? is rmdir a valid command?
I changed the command to Delete which works but it prompts me to be sure I want to delete it.

Anyway to bypass the prompt?

Thanks

The .bat file should be created in the temp folder, which you wouldn't normally see. Are you seeing it created in the folder you're working on instead?

These days you can replace the rmdir {$OriginalSource} line with this:

Delete FAILNOTEMPTY NORECYCLE QUIET FILE {$OriginalSource}

And that also allows you to set the Function drop-down to Standard Function, since it's no longer relying on MS-DOS commands to remove the folder.

It actually opens up in notepad after the script is run.
Works great now!

Thanks

The .bat filetype on your system is broken in that case. .bat files should run when launched, rather than open in Notepad.

That is likely to break a lot of other things as well (outside of Opus).

If you go to Settings > File Types, then use File > Diagnostic at the top of the window, and send the result, we might be able to tell you how to repair things. (Please post the details in a new thread.)


Edit: Copying in solution from private thread, in case it helps someone else who stumbles here:

Notepad++ took over the .bat file type:

64 HKLM\Software\Classes\.bat: "" is REG_SZ: "Notepad++_file"
64 HKLM\Software\Classes\.bat: "Notepad++_backup" is REG_SZ: "batfile"

In RegEdit, go to HKEY_LOCAL_MACHINE\Software\Classes\.bat and change the default value at the top from Notepad++_file back to batfile.