I just need to submit a simple cmd line job to execute a cmd program with a few parameters.
I wanted to test it out on Deadline 6’s own command line job plugins with a simple task of printing out the PATH of the machine that runs the job to a text file located on C: drive, like this:
PATH > C:\PATH.txt
However, every time I run the job (either Command Submission or Command Script Submission) I get this error:
0: INFO: Using Process Tree: True
0: INFO: Hiding DOS Window: True
0: INFO: Creating New Console: False
0: INFO: Executable: "C:/Windows/System32/cmd.exe"
0: INFO: Argument: PATH > C:\PATH.txt
0: INFO: Startup Directory: "C:\Windows\System32"
0: INFO: Process Priority: BelowNormal
0: INFO: Process Affinity: default
0: INFO: Process is now running
0: STDOUT: The filename, directory name, or volume label syntax is incorrect.
0: INFO: Process exit code: 1
I have no idea where to start looking for errors.
The command job sumission only pointed to the cmd.exe file with arguments PATH > C:\PATH.txt
and the command script job sumission had the same setup cmd.exe (with full path) PATH > C:\PATH.txt
There are actually a few issues here. Some are easy to fix, and one has me completely stumped.
The three quick issues are 1) the PATH variable on Windows needs to be sandwiched between ‘%’ signs, 2) ‘cmd.exe’ needs to have a ‘/c’ switch to run commands, and 3) to see the contents of a variable, you should call ‘echo’ because anything after it including variables will be sent to standard output. In summary, the options should look like this:
c:\windows\system32\cmd.exe /c echo %PATH% > c:\PATH.txt
Now, the crazy thing with this is that the redirect (’>’) didn’t work for me at all when I ran it from the command line, but it’s worth a try anyhow.
Since Deadline saves all the standard output and this is only a test, you can also try without the “> c:\PATH.txt”.
Nice! I think you hit a limitation within the Windows because your path variable is too long.
The max should be about 8K, but I wonder if cmd.exe has its own limit for the “/C” option. Microsoft says you should be fine: support.microsoft.com/kb/830473
I think you’re in good shape now anyway. Try running your Python stuff now and see how it goes.
Thanks, but the problem is, I don’t need to run Python scripts (I have IronPython or CPython submitters for that). I need to run cmd line programs with parameters for configuring certain plugins and such.
The piping is worrying. I can’t output anything into a file, for example. Or run multiple commands feeding output of one into another.
Try putting everything in a batch file perhaps? I’ve definitely done that before. It’ll need to be put somewhere that is network accessible, but that should be fine.
In fact, you can probably just call the batch file directly from a UNC path instead of using cmd.exe.
0: Plugin will be reloaded because a new job has been loaded, or one of the job files or plugin files has been modified
0: Loaded plugin: CommandScript
0: Task timeout is disabled.
0: Loaded job: Edwin’s Command Line Test (53d7f669f4b70d855493b080)
0: INFO: Executing plugin script C:\Users\Edwin\AppData\Local\Thinkbox\Deadline6\slave\MOBILE-010\plugins\53d7f669f4b70d855493b080\CommandScript.py
0: INFO: About: Command Script support for Deadline
0: INFO: The current environment will be used for rendering
0: Plugin rendering frame(s): 0
0: INFO: Checking line:"\fs-01\public\users\edwin.amsler\test.bat"
0: INFO: Stdout Handling Enabled: False
0: INFO: Popup Handling Enabled: False
0: INFO: Using Process Tree: True
0: INFO: Hiding DOS Window: True
0: INFO: Creating New Console: False
0: INFO: Executable: “\fs-01\public\users\edwin.amsler\test.bat”
0: INFO: Argument:
0: INFO: Startup Directory: “c:”
0: INFO: Process Priority: BelowNormal
0: INFO: Process Affinity: default
0: INFO: Process is now running
0: STDOUT: c:>echo C:\Program Files\Thinkbox\Deadline7\bin;C:\Program Files\Thinkbox\Deadline6\bin;C:\windows\SYSTEM32;C:\windows;C:\windows\SYSTEM32\WBEM;C:\windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0;C:\PROGRAM FILES\TORTOISESVN\BIN;C:\windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0;C:\Python27;C:\Python27\Scripts;C:\Python\Lib\site-packages\PyQt4;C:\Program Files (x86)\CMake 2.8\bin;C:\Program Files (x86)\Git\bin;C:\Program Files\TortoiseGit\bin;C:\Program Files\Common Files\Autodesk Shared\ 1>c:\test.txt
0: STDOUT: c:>echo C:\Program Files\Thinkbox\Deadline7\bin;C:\Program Files\Thinkbox\Deadline6\bin;C:\windows\SYSTEM32;C:\windows;C:\windows\SYSTEM32\WBEM;C:\windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0;C:\PROGRAM FILES\TORTOISESVN\BIN;C:\windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0;C:\Python27;C:\Python27\Scripts;C:\Python\Lib\site-packages\PyQt4;C:\Program Files (x86)\CMake 2.8\bin;C:\Program Files (x86)\Git\bin;C:\Program Files\TortoiseGit\bin;C:\Program Files\Common Files\Autodesk Shared\
0: STDOUT: C:\Program Files\Thinkbox\Deadline7\bin;C:\Program Files\Thinkbox\Deadline6\bin;C:\windows\SYSTEM32;C:\windows;C:\windows\SYSTEM32\WBEM;C:\windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0;C:\PROGRAM FILES\TORTOISESVN\BIN;C:\windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0;C:\Python27;C:\Python27\Scripts;C:\Python\Lib\site-packages\PyQt4;C:\Program Files (x86)\CMake 2.8\bin;C:\Program Files (x86)\Git\bin;C:\Program Files\TortoiseGit\bin;C:\Program Files\Common Files\Autodesk Shared
0: INFO: Process exit code: 0
0: Render time for frame(s): 3.441 s
0: Total time for task: 8.160 s
[/code]
Well, you have to realize that Deadline isn’t a command shell, so pipes and other elements that would normally work I don’t think will end up working the same as you would see in cmd.exe…