Unable to generate word output in DITA-OT if the input argument has an UNC path - dita-ot

I am trying to execute DITA-OT commands using JAVA application.
My DITA-OT sits at a separate location (application server WILDFLY) and the input files are on some other server. I'm trying to generate a word output but I'm getting an error "uri has an authority component"
The following is my command that I am trying to execute
cmd /C dita --input="\\<MACHINE_NAME>\FileServer\temp\dita-ot_00002_00001059387483239798817621042\00002_0000081949" --output="\\<MACHINE_NAME>\FileServer\temp\dita-ot_00002_00001059387483239798817621042\sc_report.docx" --format=docx

I added an issue on the DITA OT issues list:
https://github.com/dita-ot/dita-ot/issues/3673
Maybe in the meantime you can map the UNC path to a local drive and publish this way.

Related

Application cannot be executed when launch from a different folder

I have a third party application that has following two files in c:\sandbox folder.
SomeApplication.exe
SomeApplication.ini
The executable uses the ini file for various configuration settings. When I run this executable from the powershell command prompt after change my directory to c:\sandbox, all works great.
PS C:\sandbox> SomeApplication.exe
INFO: Its working great
However when I try to run same application without changing my directory to sandbox folder, it does not work.
PS C:\> .\Sandbox\SomeApplication.exe
ERROR: SomeApplication.ini could not be found
I try to do following before running the application
PS C:\> Set-Location -Path "C:\Sandbox"
But still get same error. Any idea what could be wrong?
The program assumes that it will be launched from the current directory and looks for the ini file using windows apis that search the current direction and the path. If you add it to the path it might work.

Chrome sendNativeMessage with Batch, CMD or PowerShell

Google provides an example of calling native executables here. The actual "executable" is a .BAT file which calls python. I wanted to see if I could just run a .bat file with some typical OS or maybe even PowerShell commands. According to the help the executable needs to return UTF-8 JSON so I replaced the call to python with the following command:
TYPE %~dp0\SAMPLE.json
Where SAMPLE.json is a UTF-8 file with some JSON content.
Needless to say it does not work:
Error when communicating with the native messaging host.
According to the help it could be because of message size or text vs. binary output modes. I know of no way to get a batch file to "talk binary".
Is there any way to get Chrome to talk to text based CLI utilities like batch files, powershell...?

MSBuild from Powershell

I'm trying to run a Sync from MSBuild (From Powershell) that also includes Pre Sync Commands.
I am unable to get the commands right. I've tried multiple ways, but the final way I'm up to is :
[string[]]$msdeployArgs = #(
"-verb:sync",
"-preSync:runCommand='$preSyncCommand',waitInterval=30000",
"-source:dirPath=$sourceFolder",
"-dest:computerName=$serverName,userName=$username,password=$password,authType=basic,dirPath=$serviceFolder",
"-postSync:runCommand=$postSyncCommand,waitInterval=30000"
)
& "C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" $msdeployArgs
I get the following error.
Error: Unrecognized argument
'"-preSync:runCommand='F:\Projects\Unleashed\Release_Scripts\WindowsServices\deployTopShelfServicePreCommands.cmd
Unleashed.Maintenance.JobScheduler
C:\MyCompany\Services\MyCompany.Maintenance.JobScheduler',waitInterval=30000"'.
All arguments must begin with "-".
Note that after the PreSyncCommand, is params that I want to pass to the CMD file (For it to know where to uninstall the existing service from etc.
I've ran that params via EchoArgs.exe, and the args are fine.
If it matters (It might), I'm running the powershell script from TeamCity.
I've found the issue. As it turns out, it isn't powershell with the issue, but MSDeploy. MSDeploy as far as I can see does not allow you to pass batch files with parameters. Removing the parameters works fine (But then you need to hardcode them in your batch file, or work out some other way of generating the bat files on the fly).

Getting error in command line in Tesseract in Windows

I am following this documentation-https://code.google.com/p/tesseract-ocr/wiki/TrainingTesseract3
I am trying to make a font for my language using this command-
training/ text2image --text=training_text.txt --outputbase=bn.Boishakhi.exp1 --font=Boishakhi --fonts_dir=C:\
I am getting this error
"Training is not recognized as external or internal command", on windows xp sp3 command line.
I am also having another problem.I ran tesseract successfully in windows xp sp3(English default traindata) but I cannot run it from command line to generate output in Windows 7 and 8.1. The commands I used are as follows:
cd C:\
cd Program Files
cd Tesseract-OCR
tesseract C:\Document.tif output -l eng
Please help.
I tried to change /(slash) to \ (backslash) but now the new error is "Cannot find the path specified"
As far as running in windows 7 or 8.1 is concerned, the error is "cannot create output file output.txt"
The first message means that the executable training was not found on the path. If the required executable was text2image then the space should be removed and the correct directory-separator used. \ separates directories in Windows; / introduces switches.
So training\text2image... should cure the problem, provided text2image is an executable found in training which is a subdirectory of whatever is the current directory, or you could use an absolute path, "C:\wherever\you have installed\tessteract\training\text2image" - and "note the quotes" that are required if the path to the name includes spaces (optional otherwise.)
As for your second question, you have unaccountably provided no information about any error messages you received, or how the system responded, so any response will be a guess. It may have something to do with the default protected status of the root directory C:\ and it may not. Please edit the question to include the error message or run report.

copy command syntax error in Windows XP

Basically I am just trying to create a batch file to copy one file from one location to another location in Windows XP like the code below but failed. May I know why?
copy C:/Directory_A/the_file D:/Directory_B
When I execute the batch file I see this in the output:
The syntax of the command is incorrect.
Try using backslashes
copy C:\Directory_A\the_file D:\Directory_B