NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums General General Discussion v
« Previous 1 … 23 24 25 26 27 … 159 Next »
<solved> Help needed - batchfile

 
  • 0 Vote(s) - 0 Average
<solved> Help needed - batchfile
ShiningDragon
Offline

Posting Freak

Germany
Posts: 1,493
Threads: 146
Joined: Sep 2005
#1
2012-01-23, 04:49 PM
Hi!

Because here some experts in creating batchfiles for different tasks i thought i start my question here, instead messing around.

Q: What do i want?
A: I have a huge mediaarchive. The mediaarchive contains different files in subfolders, but not like as npvr do it with recordings.

Code:
\medien\Videos\Filme\Spielfilm\FSK 00\alf.mkv
\medien\Videos\Filme\Spielfilm\FSK 00\das dschungelbuch.mkv
\medien\Videos\Filme\Spielfilm\FSK 06\banana joe.mkv
(...)

The goal i want to reach is the following:

Code:
\medien\Videos\Filme\Spielfilm\FSK 00\[B]alf[/B]\alf.mkv
\medien\Videos\Filme\Spielfilm\FSK 00\[B]das dschungelbuch[/B]\das dschungelbuch.mkv
\medien\Videos\Filme\Spielfilm\FSK 06\[B]banana joe[/B]\banana joe.mkv

I need a batch file that does:
- read the filename of any file within a subfolder
- make a dir with the name of the readed filename
- move the file into the new created dir

It would be nice, if the batch could move the coverart for the movie too (.jpg) into the new folder.


Q: Why do i want to change this?
A: Oh well, this is easy explained. A lot of movies are trilogies or even quadrologies. So i have in the sorting order first trilogies oder quadrologies and then the solo movies. This isn't an alphabetical order and it's not nice if you're searching something.

Q: Why just don't ding this manual?
A: It's no fun with 100+ files ... and lesser fun doing this with 1.000+ files

Thanks in advance for any "ready-to-use" solution or just a few sample lines. Big Grin
You like nPVR? Then please help pay the bills, and keep the project alive!

My happy NextPVR family

Frei nach Dieter Nuhr: Wenn man keine Ahnung hat, einfach mal die Fresse halten.
HarryH3
Offline

Posting Freak

U.S.A
Posts: 925
Threads: 56
Joined: Mar 2006
#2
2012-01-23, 04:54 PM
I was just looking through the wiki and remembered seeing something that might be of help. Check out the GuidePlus utility: http://www.nextpvr.com/nwiki/pmwiki.php?....GuidePlus It appears to have the ability to sort and rename files for you. I would make a good backup first though! Wink
i3-3570k, 8GB RAM, Win10 Pro, Nvidia GT710, HDHomeRun (OTA), NPVR 6.x
On a clear disk, you can seek forever...
ShiningDragon
Offline

Posting Freak

Germany
Posts: 1,493
Threads: 146
Joined: Sep 2005
#3
2012-01-23, 05:00 PM (This post was last modified: 2012-01-23, 05:09 PM by ShiningDragon.)
BackUp? While harddisks are so expensive atm? *gnihihihi*

Mhm, the explanation doesn't sound like that, what i need.
But i'll try it, perhaps it can do what i want. Big Grin
Thank you for the suggestion. Wink

EDIT:
No, no success. It's not reading the filenames and not making folders based on the filename.

Btw., i didn't mentioned the npvr recordings. The recordings are very low priority for me: record, watch, format record drive. Television in germany is awful, most times only crappy shit.
With other words: i need it for my dvd rips, which aren't stored in the npvr database (guideplus is watching there, if i do understand the explanation in the wiki right).
You like nPVR? Then please help pay the bills, and keep the project alive!

My happy NextPVR family

Frei nach Dieter Nuhr: Wenn man keine Ahnung hat, einfach mal die Fresse halten.
ShiningDragon
Offline

Posting Freak

Germany
Posts: 1,493
Threads: 146
Joined: Sep 2005
#4
2012-01-23, 06:38 PM
Okay, i've found a real interesting batch file. But due to my limited skills in those things (especially the variable ones) i need a bit help

Code:
@ECHO OFF


rem rekursiver Aufruf? (1.Parameter == /R)
if %1.==/R. goto rekursiv


rem ein Prameter vorhanden?
if %1.==. goto no_params
set src=%1
:param_

rem erster Prameter sollte der Ordner sein, wo's abgeht
if not exist %src%\* goto err_param


rem und nun für jede Datei innerhalb des Quellordners ...
rem dabei ist:
rem   '%%i'    die "For"-Variable
rem   '%0'    ist das script selbst
rem 1 '/R'    die Markierung für den rekursiven Aufruf
rem 2 '%src%'    der Quellordner
rem 3 '%%~fi' Laufwerk+Pfad+Name+Erweiterung der Datei
rem 4 '%%~pni' Laufwerk+Pfad+Name der Datei
rem 5 '%%~dpsi'    Laufwerk+Pfad+Name+Erweiterung als '8.3'
for %%i in (%src%\*.*) do call %0 /R "%src%" "%%~fi" %%~si
goto end_batch


rem --------------------------------------------------

:rekursiv
rem bin ich's selbst??? Ooops!
if %3.==%0. goto exit_batch

rem check %3 (Datei)
if not exist %3 goto err_R_Datei

rem "falschen" Ordner erstellen ...
if exist %4__\* goto err_R_Dummy
md %4__
rem ... Datei verschieben ...
move %3 %4__ >Nul
rem ... und "falschen" Ordner korrigieren...
move %4__ %3

goto exit_batch


rem --------------------------------------------------

:no_params
echo.
echo. kein Ordner angegeben...
echo. verwende aktuellen Ordner
set src=.
rem ... und Rücksprung
goto param_
rem echo. [Abbruch]
rem echo.
rem goto end_batch


:err_param
echo.
echo. Ordner "%1" scheint nicht zu existieren, kein Zugriff oder nix drin!
echo. [Abbruch]
echo.
goto end_batch

:err_R_Datei
echo. Kein Zugriff auf oder Datei "%3" existiert nicht!
echo. [skip...]
goto exit_batch

:err_R_Dummy
echo. Dummer Zufall...
echo. Dummy-Ordner "%4__" existiert bereits!
echo. [skip...]
goto exit_batch


rem --------------------------------------------------

:end_batch
rem falls noch irgendetwas zu sagen ist...
pause

:exit_batch
This one does the job i want to be done, but one thing isn't good.

This batch file reads the filename PLUS extension, and make folders based on filename PLUS extension.

What should i change so that the folders are just the filenames? Any suggestion?
You like nPVR? Then please help pay the bills, and keep the project alive!

My happy NextPVR family

Frei nach Dieter Nuhr: Wenn man keine Ahnung hat, einfach mal die Fresse halten.
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#5
2012-01-23, 06:40 PM
It's possible one of the media manager applications might help you - Ember or Media Center Master perhaps. I'm pretty sure they had options for taking folders full of AVIs, etc and putting them all into their own sub folders. That would probably handle the majority of what you've got, and hopefully leave a lot less to sort manually.

Iain
ShiningDragon
Offline

Posting Freak

Germany
Posts: 1,493
Threads: 146
Joined: Sep 2005
#6
2012-01-23, 06:53 PM
The last time i used ember media manager, it messed up some hundreds of my files. Never again i would use an external application like this on my server with some terabytes stuff. ^^
Do you have perhaps an idea at the batch file above? I try to understand the variables, but don't make progress.
You like nPVR? Then please help pay the bills, and keep the project alive!

My happy NextPVR family

Frei nach Dieter Nuhr: Wenn man keine Ahnung hat, einfach mal die Fresse halten.
ShiningDragon
Offline

Posting Freak

Germany
Posts: 1,493
Threads: 146
Joined: Sep 2005
#7
2012-01-23, 07:06 PM
Phew, luckily one me is. Big Grin

Code:
For /F "Tokens=*" %%i IN ('Dir /B *.*') do MD "%%~ni"|move "%%~i" "%%~ni\%%~i"
This one makes exactly what i want, but of one thing: it moves itself into a folder, but this isn't a big deal.

Great, so i can sort now my movies.
You like nPVR? Then please help pay the bills, and keep the project alive!

My happy NextPVR family

Frei nach Dieter Nuhr: Wenn man keine Ahnung hat, einfach mal die Fresse halten.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Tips needed for DVD ripping bgowland 9 4,303 2015-12-11, 03:43 AM
Last Post: fuffy
  Minimal media centre setup suggestions needed. bgowland 21 8,013 2014-10-10, 11:32 AM
Last Post: mvallevand
  24/7 recording - questions and help needed :) oyci3c 10 4,036 2012-07-06, 10:39 PM
Last Post: steeb
  Confusing auto-search result (solved) bgowland 2 1,663 2011-10-22, 10:44 PM
Last Post: bgowland
  Thinking of switching to GBPVR - Advice Needed gavo 6 2,622 2010-03-19, 09:36 AM
Last Post: martint123
  Vista Sleep While running Task Manager Issue - Solved Satori 0 1,377 2009-06-12, 08:59 PM
Last Post: Satori
  Freesat channel numbers needed bgowland 2 2,198 2008-12-07, 09:05 PM
Last Post: bgowland
  Regex help needed please psycik 10 3,959 2008-05-02, 04:13 AM
Last Post: psycik
  CBBC (Crystal Palace) tuning info needed bgowland 13 4,124 2007-09-29, 08:20 PM
Last Post: djmuk
  Stuck - ideas needed Knobby 22 6,356 2007-06-08, 08:33 PM
Last Post: Ted the Penguin

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode