-exec command bugged after version 5.0.3
-
- Posts: 10
- Joined: 16 Dec 2021, 21:39
-exec command bugged after version 5.0.3
Hello,
I want to execute another batch file with -exec. However, In the latest version this doesn't work anymore. With version 5.0.3 it's working fine.
The script looks like this: ... -exec "Z:\Input Serien\RenameExtra.bat" ...
The error is: "The command "Z:\Input" is not recognized as an internal or external command, operable program or batch file.
[C:\WINDOWS\system32\cmd.exe, /c, Z:\Input Serien\RenameExtra.bat, ..."
It looks like this can't be executed, because of the space in the path. I don't see in the changelogs any changes regarding the -exec command. Any help?
I want to execute another batch file with -exec. However, In the latest version this doesn't work anymore. With version 5.0.3 it's working fine.
The script looks like this: ... -exec "Z:\Input Serien\RenameExtra.bat" ...
The error is: "The command "Z:\Input" is not recognized as an internal or external command, operable program or batch file.
[C:\WINDOWS\system32\cmd.exe, /c, Z:\Input Serien\RenameExtra.bat, ..."
It looks like this can't be executed, because of the space in the path. I don't see in the changelogs any changes regarding the -exec command. Any help?
Re: -exec command bugged after version 5.0.3
![Question :?:](./images/smilies/icon_question.gif)
Code: Select all
"C:\WINDOWS\system32\cmd.exe" /c "Z:\Input Serien\RenameExtra.bat"
![Idea :idea:](./images/smilies/icon_idea.gif)
EDIT:
![Exclamation :!:](./images/smilies/icon_exclaim.gif)
test.bat
Code: Select all
echo "test.bat was called"
echo %*
Code: Select all
filebot -find *.mp4 -exec "C:\New Folder\test.bat" 1 2 3
Code: Select all
C:\New folder\Alias.1x01.mp4
C:\New Folder>echo "test.bat was called"
"test.bat was called"
C:\New Folder>echo 1 2 3
1 2 3
EDIT 2:
![Question :?:](./images/smilies/icon_question.gif)
Shell: Select all
filebot -script fn:sysinfo
Shell: Select all
filebot -script fn:sysenv
![Question :?:](./images/smilies/icon_question.gif)
-
- Posts: 10
- Joined: 16 Dec 2021, 21:39
Re: -exec command bugged after version 5.0.3
Sadly Your first command doesn't change anything. The error message is the same.
However, the quick test you suggested is working on my end:
Command and Console Output:
I usually collect several folders and drag and drop the folder into a .bat file. After a few more tests, I've figured out that the problem is somewhere in the parameters I have. Without them the command works fine. How can I set the correct behavior so that the first parameter after -exec is the batch file to run via cmd and the rest are parameters for this test.bat file? Again, this worked with 5.0.3.
Simple test command and output (german os):
filebot -script fn:sysinfo
filebot -script fn:sysenv
However, the quick test you suggested is working on my end:
Command and Console Output:
Code: Select all
Z:\Input Serien\Alias>filebot -find *.mkv -exec "Z:\Input Serien\test.bat" 1 2 3
Z:\Input Serien\Alias\Alias - S01E01.mkv
Z:\Input Serien\Alias>echo "test.bat was called"
"test.bat was called"
Z:\Input Serien\Alias>echo 1 2 3
1 2 3
Z:\Input Serien\Alias\Alias - S01E02.mkv
Z:\Input Serien\Alias>
Simple test command and output (german os):
Code: Select all
Z:\Input Serien\Alias>filebot -find *.mkv -r -exec "Z:\Input Serien\test.bat" "{folder}\{historic.f.dir.name}"
Z:\Input Serien\Alias\Alias - S01E01.mkv
Der Befehl "Z:\Input" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
[C:\WINDOWS\system32\cmd.exe, /c, Z:\Input Serien\test.bat, Z:\Input Serien\Alias\] failed (1)
Code: Select all
FileBot 5.1.2 (r10125)
JNA Native: 6.1.6
MediaInfo: 23.10
7-Zip-JBinding: 16.02
Tools: fpcalc/1.5.0
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2023-11-06 (r952)
Groovy: 4.0.15
JRE: OpenJDK Runtime Environment 17.0.8
JVM: OpenJDK 64-Bit Server VM
CPU/MEM: 16 Core / 8 GB Max Memory / 140 MB Used Memory
OS: Windows 10 (amd64)
STORAGE: NTFS [(C:)] @ 113 GB | NTFS [Lokaler Datentrõger] @ 1.5 TB | NTFS [Fast] @ 1.9 TB | NTFS [Seagate Expansion Drive] @ 2.2 TB | NTFS [Hitachi] @ 673 GB | NTFS [Archiv] @ 22 TB
DATA: C:\Users\scherzeking\AppData\Roaming\FileBot
Package: MSI
License: FileBot License PX31332569 (Valid-Until: 2071-12-04)
Done ?(?????)?
Code: Select all
# Local Time #
Sun Dec 31 14:03:41 CET 2023
# Process Tree #
C:\Windows\explorer.exe
└─ C:\Windows\System32\cmd.exe
└─ D:\Program Files\FileBot\filebot.exe
└─ D:\Program Files\FileBot\jre\bin\java.exe
# Environment Variables #
=::: ::\
=C:: C:\Windows\System32
=ExitCode: 00000000
ACSetupSvcPort: 23210
ACSvcPort: 17532
ALLUSERSPROFILE: C:\ProgramData
AMDRMPATH: C:\Program Files\AMD\RyzenMaster\
APPDATA: C:\Users\scherzeking\AppData\Roaming
COMPUTERNAME: ASUS-PC
ChocolateyInstall: C:\ProgramData\chocolatey
ChocolateyLastPathUpdate: 133168683023187149
ChocolateyToolsLocation: C:\tools
ComSpec: C:\WINDOWS\system32\cmd.exe
CommonProgramFiles: C:\Program Files\Common Files
CommonProgramFiles(x86): C:\Program Files (x86)\Common Files
CommonProgramW6432: C:\Program Files\Common Files
DriverData: C:\Windows\System32\Drivers\DriverData
HOMEDRIVE: C:
HOMEPATH: \Users\scherzeking
JAVA_HOME: C:\PROGRA~1\Java\JDK-13~1.2
JD2_HOME: C:\Program Files (x86)\JDownloader 2.0
LOCALAPPDATA: C:\Users\scherzeking\AppData\Local
LOGONSERVER: \\ASUS-PC
NUMBER_OF_PROCESSORS: 16
OS: Windows_NT
OneDrive: C:\Users\scherzeking\OneDrive
PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE: AMD64
PROCESSOR_IDENTIFIER: AMD64 Family 23 Model 113 Stepping 0, AuthenticAMD
PROCESSOR_LEVEL: 23
PROCESSOR_REVISION: 7100
PROMPT: $P$G
PSModulePath: C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
PUBLIC: C:\Users\Public
Path: c:\program files (x86)\common files\oracle\java\javapath;c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\system32\windowspowershell\v1.0\;c:\windows\system32\openssh\;c:\program files\dotnet\;d:\program files (x86)\streamlink\bin;c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\system32\windowspowershell\v1.0\;c:\windows\system32\openssh\;c:\programdata\chocolatey\bin;c:\program files\putty\;c:\tools\nirlauncher\nirsoft;c:\program files\microsoft sql server\120\tools\binn\;d:\program files\git\cmd;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;D:\Program Files\FileBot\;C:\Users\scherzeking\AppData\Local\Programs\Python\Python310\Scripts\;C:\Users\scherzeking\AppData\Local\Programs\Python\Python310\;C:\Users\scherzeking\AppData\Local\Microsoft\WindowsApps;;D:\Program Files\JetBrains\PhpStorm 2019.3.1\bin;;D:\Program Files\FileBot\jre\bin
PhpStorm: D:\Program Files\JetBrains\PhpStorm 2019.3.1\bin;
ProgramData: C:\ProgramData
ProgramFiles: C:\Program Files
ProgramFiles(x86): C:\Program Files (x86)
ProgramW6432: C:\Program Files
RlsSvcPort: 22112
SESSIONNAME: Console
SystemDrive: C:
SystemRoot: C:\WINDOWS
TEMP: C:\Users\SCHERZ~1\AppData\Local\Temp
TMP: C:\Users\SCHERZ~1\AppData\Local\Temp
USERDOMAIN: ASUS-PC
USERDOMAIN_ROAMINGPROFILE: ASUS-PC
USERNAME: scherzeking
USERPROFILE: C:\Users\scherzeking
windir: C:\WINDOWS
# Java System Properties #
application.deployment: msi
application.dir: C:\Users\scherzeking\AppData\Roaming\FileBot
file.encoding: Cp1252
file.separator: \
grape.root: C:\Users\scherzeking\AppData\Roaming\FileBot\grape
http.agent: FileBot/5.1.2
java.class.path: D:\Program Files\FileBot\jar\filebot.jar
java.class.version: 61.0
java.home: D:\Program Files\FileBot\jre
java.io.tmpdir: C:\Users\scherzeking\AppData\Roaming\FileBot\tmp
java.library.path: D:\Program Files\FileBot\lib
java.net.useSystemProxies: true
java.runtime.name: OpenJDK Runtime Environment
java.runtime.version: 17.0.8+7
java.specification.name: Java Platform API Specification
java.specification.vendor: Oracle Corporation
java.specification.version: 17
java.vendor: Eclipse Adoptium
java.vendor.url: https://adoptium.net/
java.vendor.url.bug: https://github.com/adoptium/adoptium-support/issues
java.vendor.version: Temurin-17.0.8+7
java.version: 17.0.8
java.version.date: 2023-07-18
java.vm.compressedOopsMode: Zero based
java.vm.info: mixed mode, sharing
java.vm.name: OpenJDK 64-Bit Server VM
java.vm.specification.name: Java Virtual Machine Specification
java.vm.specification.vendor: Oracle Corporation
java.vm.specification.version: 17
java.vm.vendor: Eclipse Adoptium
java.vm.version: 17.0.8+7
jdk.debug: release
jdk.logger.packages: net.filebot.Logging
jna.boot.library.path: D:\Program Files\FileBot\lib
jna.library.path: D:\Program Files\FileBot\lib
jna.loaded: true
jna.noclasspath: true
jna.nosys: true
jna.nounpack: true
jnidispatch.path: D:\Program Files\FileBot\lib\jnidispatch.dll
line.separator:
native.encoding: Cp1252
net.filebot.AcoustID.fpcalc: D:\Program Files\FileBot\lib\fpcalc.exe
net.filebot.UserFiles.fileChooser: COM
org.apache.commons.logging.Log: org.apache.commons.logging.impl.NoOpLog
os.arch: amd64
os.name: Windows 10
os.version: 10.0
path.separator: ;
prism.order: sw
sun.arch.data.model: 64
sun.boot.library.path: D:\Program Files\FileBot\jre\bin
sun.cpu.endian: little
sun.cpu.isalist: amd64
sun.io.unicode.encoding: UnicodeLittle
sun.java.command: D:\Program Files\FileBot\jar\filebot.jar -script fn:sysenv
sun.java.launcher: SUN_STANDARD
sun.java2d.d3d: false
sun.jnu.encoding: Cp1252
sun.management.compiler: HotSpot 64-Bit Tiered Compilers
sun.net.client.defaultConnectTimeout: 10000
sun.net.client.defaultReadTimeout: 60000
sun.os.patch.level:
sun.stderr.encoding: cp850
sun.stdout.encoding: cp850
swing.crossplatformlaf: javax.swing.plaf.nimbus.NimbusLookAndFeel
unixfs: false
useCreationDate: false
useExtendedFileAttributes: true
useNativeShell: false
user.country: DE
user.dir: C:\Windows\System32
user.home: C:\Users\scherzeking
user.language: de
user.name: scherzeking
user.script:
user.timezone: Europe/Berlin
user.variant:
# Arguments #
args[0] = -script
args[1] = fn:sysenv
Done ?(?????)?
Re: -exec command bugged after version 5.0.3
I see. So you have a *.bat script that uses parameters like %1 to %* and then passes them on to a filebot command. That's important context.scherzeking wrote: ↑31 Dec 2023, 13:47 I usually collect several folders and drag and drop the folder into a .bat file. After a few more tests, I've figured out that the problem is somewhere in the parameters I have. Without them the command works fine. How can I set the correct behavior so that the first parameter after -exec is the batch file to run via cmd and the rest are parameters for this test.bat file? Again, this worked with 5.0.3.
![Question :?:](./images/smilies/icon_question.gif)
![Exclamation :!:](./images/smilies/icon_exclaim.gif)
![Laughing :lol:](./images/smilies/icon_lol.gif)
![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)
-
- Posts: 10
- Joined: 16 Dec 2021, 21:39
Re: -exec command bugged after version 5.0.3
Ye, I know I'm one of those people, who uses batch files xD
I think it's not a batch file problem. Something changed in the -exec command, because the test.bat was the same as yours above. Can you not reproduce it with the command above (The Simple test command and output)?
If you really want something I've used in my real batch file here it is:
the drag and drop folder on batch file:
the test.bat
output
I think it's not a batch file problem. Something changed in the -exec command, because the test.bat was the same as yours above. Can you not reproduce it with the command above (The Simple test command and output)?
If you really want something I've used in my real batch file here it is:
the drag and drop folder on batch file:
Code: Select all
@echo off
SET input=%1
SET output="Z:\Output Serien"
SET "inputNEW=%~1"
SET "inputNEW=%inputNEW:&=^&%"
filebot -rename -r %input% --format "{n} ({y})/{episode.special ? 'Specials' : 'Season '+s}/{episode.special ? 'S00E'+special.pad(2) : s00e00} - {t.take(128)}{ subt }{ if (f.subtitle) '(' + fn.match(/_(\d{1,2})$|\((\d{1,2})\)$|^(\d+)_/) + ')' }" --db TheTVDB --lang German --mode interactive -non-strict --apply import --output %output% -exec "Z:\Input Serien\test.bat" "{folder}\{historic.f.dir.name}"
pause
Code: Select all
@Echo Off
if not exist %1 mkdir %1
Code: Select all
Rename episodes using [TheTVDB] with [Airdate Order]
Fetching episode data for [Alias]
* Alias - Die Agentin [75930] | 105 episodes | 1x01-22 .. 2x01-22 .. 3x01-22 .. 4x01-22 .. 5x01-17
[MOVE] from [Z:\Input Serien\Alias\Alias - S01E01.mkv] to [Z:\Output Serien\Alias - Die Agentin (2001)\Season 1\S01E01 - Tödliche Wahrheit.mkv]
[MOVE] from [Z:\Input Serien\Alias\Alias - S01E02.mkv] to [Z:\Output Serien\Alias - Die Agentin (2001)\Season 1\S01E02 - Neuanfang.mkv]
Der Befehl "Z:\Input" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
[C:\WINDOWS\system32\cmd.exe, /c, Z:\Input Serien\test3.bat, Z:\Output Serien\Alias - Die Agentin (2001)\Season 1\Alias] failed (1)
Processed 2 files
Re: -exec command bugged after version 5.0.3
![Question :?:](./images/smilies/icon_question.gif)
test.bat
Code: Select all
echo "BEGIN test.bat"
echo "Parameter 1 = %1"
if not exist %1 mkdir %1
echo "END test.bat"
![Idea :idea:](./images/smilies/icon_idea.gif)
-
- Posts: 10
- Joined: 16 Dec 2021, 21:39
Re: -exec command bugged after version 5.0.3
Nothing changes with the output with your suggestion.
I think the issue is not the test.bat file. Even if I don't use any parameters in that file with %1 %2 etc. the error is the same. The -exec trys to execute the second parameter "{folder}\{historic.f.dir.name}", which fails. Is there a way to declare this as a parameter used for the test.bat file and not to execute it again with a new cmd.rednoah wrote: ↑31 Dec 2023, 15:34If have reason to believe that your script might be successfully called by filebot, your script then calls mkdir which then prints Der Befehl "Z:\Input" ist entweder falsch geschrieben oder konnte nicht gefunden werden. to console output and fails with exit code 1 for some reason.
Re: -exec command bugged after version 5.0.3
This line in the console output:
means that FileBot is trying to execute this command:
This looks good to me at a glance. filebot executes cmd which then executes test3.bat. I don't see anything that can go wrong here.
i.e. Execute C:\WINDOWS\system32\cmd.exe and pass arguments:
I'm not using Windows at the moment, so I can't easily run lots of tests.
Code: Select all
[C:\WINDOWS\system32\cmd.exe, /c, Z:\Input Serien\test3.bat, Z:\Output Serien\Alias - Die Agentin (2001)\Season 1\Alias] failed (1)
Code: Select all
"C:\WINDOWS\system32\cmd.exe" /c "Z:\Input Serien\test3.bat" "Z:\Output Serien\Alias - Die Agentin (2001)\Season 1\Alias"
i.e. Execute C:\WINDOWS\system32\cmd.exe and pass arguments:
Code: Select all
1: /c
2: Z:\Input Serien\test3.bat
3: Z:\Output Serien\Alias - Die Agentin (2001)\Season 1\Alias
I'm not using Windows at the moment, so I can't easily run lots of tests.
Re: -exec command bugged after version 5.0.3
![Exclamation :!:](./images/smilies/icon_exclaim.gif)
Code: Select all
X:\>cmd /c "C:\Program Files\FileBot\filebot.exe" -version
FileBot 5.1.2 (r10125)
Code: Select all
X:\>cmd /c "C:\Program Files\FileBot\filebot.exe" "-version"
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
![Idea :idea:](./images/smilies/icon_idea.gif)
Code: Select all
X:\>cmd /c call "C:\Program Files\FileBot\filebot.exe" "-version"
FileBot 5.1.2 (r10125)
![Question :?:](./images/smilies/icon_question.gif)
Shell: Select all
-exec call "Z:\Input Serien\test.bat" "{folder}\{historic.f.dir.name}"
![Question :?:](./images/smilies/icon_question.gif)
EDIT:
https://stackoverflow.com/a/73470776/1514467 has some explanation as to why cmd behaves differently depending on the arguments.
EDIT 2:
FileBot r10169 removes cmd /c usage because it clearly does more harm than good in terms of introducing unexpected inconsistent behaviours. %PATH% resolution can be done by FileBot itself head of time. CMD built-in commands and custom %PATHEXT% executables will no longer work though.
-
- Posts: 10
- Joined: 16 Dec 2021, 21:39
Re: -exec command bugged after version 5.0.3
With "call" it works again. Thank you very much. I knew filebot had changed something, but could not find it.
I have no idea why cmd and batch files behave this way. I had too many headaches to make it work in the first place. So I don't want to rewrite everything. I'm glad I can leave it as it is. You can close the thread, if you want to.
Oh, and Happy New Year btw.
I have no idea why cmd and batch files behave this way. I had too many headaches to make it work in the first place. So I don't want to rewrite everything. I'm glad I can leave it as it is. You can close the thread, if you want to.
Oh, and Happy New Year btw.
Re: -exec command bugged after version 5.0.3
Cheers and HNY~
Keep in mind that r10169 and up will no longer require the call workaround, and call will likely no longer work since it's a CMD built-in, so after the next update you can go back to just having Windows execute the *.bat file directly.
![Idea :idea:](./images/smilies/icon_idea.gif)