1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Development Sabnzbd/XenonMKV Scripting Help (Batch File)

Discussion in 'Software' started by soopahfly, 15 Dec 2010.

  1. soopahfly

    soopahfly Minimodder

    Joined:
    12 Jan 2002
    Posts:
    159
    Likes Received:
    7
    I've currently got this script

    Code:
    cd /d %1
    IF NOT EXIST *.mkv GOTO NOMKV
    del *sample*.*
    del *.srr
    del *.srt
    del *.nfo
    del *.nzb
    IF EXIST *.mkv XenonMKV.exe -inputfolder %1 -outputfolder %1
    cd /d %1
    IF EXIST *.mp4 del *.mkv
    :NOMKV
    exit
    
    Which works well on my downloader.
    The problem I've got is I've got SABNZBD set to move anything I categorise as "HD" be moved to drive T:\ - The script then starts to convert the file on my NAS. Which is VERY SLOW.
    I can set it quite easily to not move the file, but does anyone know a way of getting it to move the converted folder to drive T: after processing?
     
    Last edited: 15 Dec 2010
  2. thehippoz

    thehippoz What's a Dremel?

    Joined:
    19 Dec 2008
    Posts:
    5,780
    Likes Received:
    174
    been while since wrote dos batch files.. but the move command should do it

    move %1 t:\ or move "%1" t:\

    one of those should move the file you put in the piehole.. just a tip if you write a lot of batch files you can use the | to run more than one command a line..

    running a vb script you can do a nice move (source folder a to b) and rename any existing files with the same name to xxx_1.xxx (found this on whirlpool forums but it looks like it'd work good for what your doing)

    hope it helps

    Code:
    Loop through every file in the folder checking if that file exists in the destination before moving.
    
    sSource = folder A
    sDestination = folder B
    Set objFSO = CreateObject("Scripting.FileSystem­ Object")
    Set fld = objFSO.getfolder(sSource)
    For Each f In fld.files
    If objFSO.FileExists(sDestination & f.Name) Then
    objFSO.MoveFile f.Path, sDestination & Left(f.Name, InStrRev(f.Name, ".") - 1) & "_1" & Mid(f.Name, InStrRev(f.Name, "."))
    Else
    objFSO.MoveFile f.Path, sDestination & f.Name
    End If
    Next
    
     
  3. soopahfly

    soopahfly Minimodder

    Joined:
    12 Jan 2002
    Posts:
    159
    Likes Received:
    7
    Thanks for that!

    I'm going to give it a try now.
     

Share This Page