Can you try with the full path in the command line?
I was annoyed at the screenshot because if it had been taken 10 minutes earlier, it would have shown the full path. So unfortunately I have already tried this.
Try the following command line for batch files:
cmd.exe datetime.bat
For Powershell:
powershell.exe datetime.ps1
I was annoyed at the screenshot because if it had been taken 10 minutes earlier, it would have shown the full path. So unfortunately I have already tried this.
Okay, the full path is definitely the way to go. When you try that, do you see any error messages in the translation log?
Does the batch file run properly from the command line?
Try the following command line for batch files:
cmd.exe datetime.bat
For Powershell:
powershell.exe datetime.ps1
I have tried using cmd.exe. Both attempts used the full path for the batch file. I have tried with datetime.bat in quotation marks and without. However unfortunately it is still not working.
I have tried using cmd.exe. Both attempts used the full path for the batch file. I have tried with datetime.bat in quotation marks and without. However unfortunately it is still not working.
Be careful if you have spaces anywhere in the command line, the SystemCaller is a bit weird about them, see also the documentation.
Here's a working example:
""c:\temp\date and time.bat" ABC"
This calls the batch file "date and time.bat" with the command line parameter "ABC". Note the extra set of double quotes around the entire command.
I have tried various options, as many permutations as I can think of. With quotation marks and without. Just the name of the batch file, the name of the batch file, preceded with "cmd ", with no quotation marks, quotation marks around the whole line or just around the batch filename.
I just made my own datetime.bat ran it through the SystemCaller with no issues. Here is what I have:
LOG:
SystemCaller: Executing `C:\\tmp\\fstmpsc_akboyd\\datetime.bat'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
C:\\Windows>echo Tue 08/29/2023 11:26:30.41 1>>C:\\tmp\\fstmpsc_akboyd\\devtracker.log
Result:
If you are using windows supported paths it should work in theory.......is your .bat executing from a UNC path? Or is the code in the .bat using a UNC path? Any UNC path will have to be changed and mostly likely converted to a network drive path (map to T: for example).
In the FME logs of the workbench, when your systemcaller is executing.....what do the messages say? Does it say the .bat is executing?
Thanks, that solved my initial problem-the batch file is now working.
I did not realise I needed a creator transformer first! The power shell script is not working yet but that's down to some antivirus software on the server.
Unfortunately, I have another problem.
The workspace now successfully executes the power shell script. The script retrieves active directory users and the results are output to a Json file. The problem I am finding, is that if I bring too many users back, it results in an empty Json file. We discovered this when we tried to use FME to return a call ll the users.
Therefore, we had the idea of testing it by running it for all users begin with A, then A and B etc. When I did this, everything worked until I believe users begin with M. To cut a long story short, I discovered it was not particular letters that caused the issue but I believe the amount of data. This was because I could include problematic letters, if I dropped earlier letters in the alphabet.
I should emphasise that the problem only occurs when I tried to run the power shell script through FME. When I run the script, out with FME, the script runs correctly, even for all the users, which results in a file about 330 MB in size.
Any idea what could be the issue?
be carefull of merging different technology disiplines. It creates technical debt and becomes complicated to maintain in the long run. Why not create the same logic with the power of FME and, get rid of that old script?