Command line control

sstteevvee

16-02-2009 11:04:42

The recent 2.1.1 alpha versions have command line support, which may or may not work. :) These can be put in a shortcut, a batch file, or run from Windows' task scheduler.

Command line arguments:
  1. /hide - hide the TVRename window and notification icon while operations are carried out (implies /quit)[/*:m]
  2. /quit - quit tvrename when done[/*:m]
  3. /missingcheck - do a missing check[/*:m]
  4. /exportmissingxml <filename> - export the missing list as XML to the specified filename[/*:m]
  5. /exportmissingcsv <filename> - export the missing list as CSV to the specified filename[/*:m]
  6. /renamingcheck - do a renaming check[/*:m]
  7. /exportrenamingxml <filename> - export the renaming list as XML to the specified filename[/*:m]
  8. /renamingdo - carry out the renaming actions[/*:m]
  9. /fnocheck - do a finding & organising check (make sure you do a /missingcheck first!)[/*:m]
  10. /exportfnoxml <filename> - export the finding & organising list XML to the specified filename[/*:m]
  11. /fnodo - do the finding & organising actions (need to do a /fnocheck first)[/*:m][/list:u]
    From 2.1.1a5 on:
    1. /ignoremissing - Ignore missing folders when doing missing check (default if /hide is used. Otherwise, the usual prompt dialog will be shown)[/*:m]
    2. /createmissing - Create missing folders when doing missing check[/*:m][/list:u]

      If you do something like:


      tvrename.exe /renamingcheck /renamingdo /missingcheck /fnocheck /fnodo /quit

      That will make it check for files needing to be renamed, then rename them, then check for missing files, do a finding&organising check for them, move/copy the files found, then quit. Add "/hide" if you want it all to happen without the window coming up.

      The command line arguments are the same as hitting the equivalent buttons in the program, so should work just as well. Its not something I have tested extensively, so post back here or in the bugs forums with any problems, etc.

shoppedude

05-03-2009 04:31:47

Never mind. I was not running the current versions.

Thanks,
Lee

hoogy

23-03-2009 17:11:36

How do you make it just copy and not move the files using the commands.

sstteevvee

26-03-2009 11:01:01

Making it copy instead of move can't be done at the moment with command-line. I'll add it to a future release.

stewood

11-04-2009 02:56:19

Awsome feature.

TVRename has always had more control and power than anything else, but now that that it can be automated I can finaly throw away the "other" renamers.

Thanks TVRename!

-Stephen

jocke

29-04-2009 03:59:52

I guess you can't run command line controls while TVR is still open?

batch.cmd
TVRename.exe /missingcheck /fnocheck /fnodo

Doesn't work.

edit: and yes, batch.cmd is in the same folder as TVRename.exe.

anewn

29-04-2009 20:26:10

I'm using 2.1.1.a6. Here's my command line...tvrename.exe /hide /missingcheck /fnocheck /fnodo /quit
Even with the /missingcheck first it prompts for one when /fnocheck runs.

Am I missing something?

sstteevvee

01-05-2009 15:13:00

It's probably a bug.. If /missingcheck finds nothing, then /fnocheck will bug you to go a missing check. I'll have a look into it.

anewn

01-05-2009 17:51:27

I've put a feature request (along with 3945739574 others) in with uTorrent to add a 'run command/program' when download finishes. Bundled with this feature of TVR... I'll never have to manually rename/move/sort a TV show again.

I thought about that where if there is no results in the /missingcheck it might not know to skip it in /fnocheck

I've manually put back a file previously sorted and moved. When there is a file that is in the missing list. It does work as you describe it. However, it shows the CMD window and the move window during the process. (not a big deal for me)

It just doesn't know how to skip if there are no results to process.

stewood

01-05-2009 23:51:47

I have given up on uTorrent adding a default post processing options, it has been on the feature list for over a year.

My interum solution is to monitor the complete directory and run commands when new files are added.

I have moved my solution to a service, but here is a copy of the vbs file that I wrote a while back that will monitor a directory for a file and then launch tvrename.


Set objShell = CreateObject("Wscript.Shell")

strComputer = "."
strCMD = """c:\Program Files (x86)\TVRename\tvrename.exe"" /renamingcheck /renamingdo /missingcheck /fnocheck /fnodo /quit"
'Wscript.Echo strCMD
'objShell.Run(strCMD)

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colMonitoredEvents = objWMIService.ExecNotificationQuery _
("SELECT * FROM __InstanceCreationEvent WITHIN 10 WHERE " _
& "Targetinstance ISA 'CIM_DirectoryContainsFile' and " _
& "TargetInstance.GroupComponent= " _
& "'Win32_Directory.Name=""c:\\\\TORRENT\\\\done""'")

Do
Set objLatestEvent = colMonitoredEvents.NextEvent
strNewFile = objLatestEvent.TargetInstance.PartComponent
arrNewFile = Split(strNewFile, "=")
strFileName = arrNewFile(1)
strFileName = Replace(strFileName, "\\", "\")
strFileName = Replace(strFileName, Chr(34), "")
'objShell.Run("notepad.exe " & strFileName)
objShell.Run(strCMD)
Loop



farfromrefuge

09-05-2009 09:57:22

I have given up on uTorrent adding a default post processing options, it has been on the feature list for over a year.

My interum solution is to monitor the complete directory and run commands when new files are added.

I have moved my solution to a service, but here is a copy of the vbs file that I wrote a while back that will monitor a directory for a file and then launch tvrename.


Set objShell = CreateObject("Wscript.Shell")

strComputer = "."
strCMD = """c:\Program Files (x86)\TVRename\tvrename.exe"" /renamingcheck /renamingdo /missingcheck /fnocheck /fnodo /quit"
'Wscript.Echo strCMD
'objShell.Run(strCMD)

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colMonitoredEvents = objWMIService.ExecNotificationQuery _
("SELECT * FROM __InstanceCreationEvent WITHIN 10 WHERE " _
& "Targetinstance ISA 'CIM_DirectoryContainsFile' and " _
& "TargetInstance.GroupComponent= " _
& "'Win32_Directory.Name=""c:\\\\TORRENT\\\\done""'")

Do
Set objLatestEvent = colMonitoredEvents.NextEvent
strNewFile = objLatestEvent.TargetInstance.PartComponent
arrNewFile = Split(strNewFile, "=")
strFileName = arrNewFile(1)
strFileName = Replace(strFileName, "\\", "\")
strFileName = Replace(strFileName, Chr(34), "")
'objShell.Run("notepad.exe " & strFileName)
objShell.Run(strCMD)
Loop





I llove it! how do you add that as a aservice?

timm.mccoy

02-09-2009 17:46:30

command line arguments broken due to all in one tab and the new scan function?

I have the most recent version of TVR (2.2.0a4)

and i wrote a script that will tell TVR to run and do the usual renaming and sorting and what-not

"C:\Program Files (x86)\TVRename\TVRename.exe" /hide /renamingcheck /renamingdo /missingcheck /fnocheck /fnodo /quit

when i run this everything seems to work (when i remove /hide the TVR window opens) but my files don't get renamed or sorted. I have this set to run as a scheduled task every 5 minutes so that my TV shows will get sorted in a timely manner.

I'm using Windows 7 64-bit if that makes any difference. the application itself works fine, but without the scripting support (or a true folder watch system) i have to constantly run TVR by hand. which kills the convenience factor.

i also tried using a /scan argument to see if that would run the new scan function (it didn't)

anything i can do about this/are you working on this?

raedur

02-11-2009 19:58:27

any updates? this feature still seems to be broken

bnevets27

03-11-2009 18:21:54

Some features have not yet been re-implemented in this version. There is no command line arguments, and no exporting of missing, renaming, etc. lists. This will be re-added by the time it's in beta, though

That was posted in version 2.2.0 alpha 1, so it's not really broke, but not reimplemented yet.

If you go back to 2.1.1 alpha 6, command line control should work.

Makaveli6103

18-02-2010 11:09:48

command line arguments broken due to all in one tab and the new scan function?

I have the most recent version of TVR (2.2.0a4)

and i wrote a script that will tell TVR to run and do the usual renaming and sorting and what-not

"C:\Program Files (x86)\TVRename\TVRename.exe" /hide /renamingcheck /renamingdo /missingcheck /fnocheck /fnodo /quit

when i run this everything seems to work (when i remove /hide the TVR window opens) but my files don't get renamed or sorted. I have this set to run as a scheduled task every 5 minutes so that my TV shows will get sorted in a timely manner.

I'm using Windows 7 64-bit if that makes any difference. the application itself works fine, but without the scripting support (or a true folder watch system) i have to constantly run TVR by hand. which kills the convenience factor.

i also tried using a /scan argument to see if that would run the new scan function (it didn't)

anything i can do about this/are you working on this?


I tried to do this also. The first time I ran it by just double clickin on it and not running the task scheduler, it worked fine. Now it does not work anymore.

the_stig

27-02-2010 09:09:53

I'm using Alpha5, and no matter what I do with my rename.bat file, I can't stop the prompt to do a missing check when the script runs. I've tried every order of the arguments I can think of, nothing is working. here is what I currently have, though I change it often trying to find the magic combo that will get rid of the prompt

"C:\Program Files\TVRename\tvrename.exe" /hide /renamingcheck /renamingdo /missingcheck /fnocheck /fnodo

I have tried using /createmissing and /ignoremissing as well, no difference. This is getting to be a pain, alllllmost have everything automated for my XBMC usage!

the_stig

27-02-2010 15:09:11

to answer my own question (I think), the problem may have been the order - /hide had to be at the back. As below.

"C:\Program Files\TVRename\TvRename.exe" /renamingcheck /renamingdo /missingcheck /fnocheck /fnodo /hide


at least I think so - I've had it working several times, then out of the blue, it would start popping up the prompt again.


*edit - NOPE. Popup prompts are back again. no changes made. And I do have missing shows when I run TV rename in the GUI - so if it is actually executing /checkmissing first among the arguments, it should have some results to check against. This is killing me.

the_stig

28-02-2010 13:14:17

FINALLY i have it working for sure, thanks to stewood's code on the first page of this thread.

I'm obviously below his skill level with code, so for anyone else like me, here's what you do - copy his code into a new .txt file. Change
"""c:\Program Files (x86)\TVRename\tvrename.exe"" to wherever the .exe is on your computer.
change
& "'Win32_Directory.Name=""c:\\\\TORRENT\\\\done""'") to whichever directory you want watched. make sure to keep the quadruple slashies in there. they are needed.
Save the file. Rename it <anything>.vbs and put it in your tvrename directory in program files. Double click it. Now anytime a file is introduced into your watch folder, tvrename will run - and it doesn't prompt for a missing check! This solution is brilliant since there is no need to run anything on a schedule. It runs as many or as few times as it needs to. THANK YOU stewood!!!!!

LurchQPublic

12-04-2010 00:08:12

I noticed that version 2.2.0b1 does have command line options added back in, and it says:


Command-line control added (missing since earlier 2.1.x versions). Slightly different set of commands, though: /quit /hide /scan /doall /ignoremissing /createmissing

the_stig

13-04-2010 08:28:10

**edit - figured out the problem, somewhat. Tvrename *is* processing some of my new files, but not others. Tvrename should know to look for those files, as they show as "aired" in my "myshows" episode guide in the program. But when I scan, either manually, or automatically with my script, they are not showing up as "missing" in the scan results. I double checked that each series is pointed to the right base/season folder location. I didn't have to reconfigure tvrename when I installed the new version - it took my settings and data from the previous installation of the old version. But I checked everything anyway.

No idea why it is selectively not scanning for some shows.





awesome that there is a new release with the command lines options returning.

I downloaded the new version, but can't get the commands to work. I had it working fine with the earlier release.
I have a visual basic script watching my download folder that starts tvrename.exe when something new shows up.
TV Rename is starting in the background when something in the download folder changes, but it's not renaming the files contained therein, or moving them out to the proper folders. It isn't a problem with filenames, they are well named, and episodes from the same show/season were working as recently as a couple days ago with the previous version of tvrename that supported commands.

with the new version I am passing:

/hide /scan /doall /createmissing

I am assuming that as before, /hide infers /quit. And that I don't want to pass both /createmissing and /ignoremissing since they are different options to deal with the same condition.

I guess what would be most helpful is an explanation of what all the arguments do.

general

15-04-2010 08:27:02

The Stig.... was this what you were after? --->http://tvrename.com/bb/viewtopic.php?f=7&t=648
the notes for beta 2 indicate there is an issue with the /hide option that is being looked at.

the_stig

15-04-2010 08:48:41

ah, I didn't notice that there were problems with /hide.

For now I've reverted back to the older version. Everything is still working fine with that one, I'm only losing the download of the thumbnails and .nfo's.

Will watch for a fix for 2.2

Thanks general!

sstteevvee

26-04-2010 14:15:01

Yes - 2.2.0b1 had a bug where /hide would mean that any copying+moving didn't happen. Should be fixed in 2.2.0b3 (and 2.2.0b4, which I'll be uploading later today).

/hide does imply /quit, unless tvrename is already open and running - in which case, the things to do are just passed to the currently running tvrename.

jorgeaaabr

01-02-2012 11:23:21

Guys, I don't know if I'm excited about old news, but uTorrent now has a feature that allows the user to set a program to run after each torrent completion.

It's accessible in the configuration menu (my uTorrent is in portuguese, so...), under the category "advanced".

Of course I couldn't do it anyway :/ I'm useless with computer codes...

Anyone who could help posting the steps and command line to make this GREAT program run after each torrent completion?

Thanks a lot!