Porblem with shell in LS agent called from web

Hi,

I try to start a batch file from a web form with @command[toolsrunagent]:

This batch routine has imagemagick commands like “convert”, so I think I have to start it in a new DOS window (otherwise it starts in the server console, and domino gives error messages for the convert command).

Code is quite simple:

result = Shell(“start E:\dummy.bat”)

this gets me a “file not found” error.

if I use

result = Shell(“E:\dummy.bat”) the batch starts, but…as mentioned above, domino server tries to convert…)

Am I sth missing??

Thanks - Uwe

Subject: porblem with shell in LS agent called from web

Why not create a second bat file, that makes use of start dummy.bat?

  • Johan

johan@kanngard.net

http://dev.kanngard.net

Subject: problem with shell in LS agent called from web

johan, thanks for the quick response

tried your tip: the called batch starts in a new window, but it still looks as if the batch tries to use the wrong convert command:

one of the error messages is: “Unzulässiger Parameter - -resize”

Now I am a bit confused, I first thought it uses the domino convert command - but the german error message (our dom server is english, afa I know) looks like an error from the (german) OS? W2000 has a convert command too!

quite confused…

Uwe

Subject: RE: problem with shell in LS agent called from web

you said the batch file actually runs so if domino is english and the os is german then the error is from one of the commands within the batch file, specifically the one using a -resize parameter.

can you post the contents of the batch file as that would probably help more.

Subject: RE: problem with shell in LS agent called from web

Sure the error is caused from a command of the batch file: the “convert” command. But if I run the batch from a dos box (in whatever directory), it works well. Only running it from the domino agent (in the console or a 2nd opened window, called from a 2nd batch file as proposed in the other answer) causes the error.

Here’s the batch:

==================================

REM Ordner “thumbs” anlegen

chdir %1

IF not exist thumbs mkdir thumbs

REM Bilder in Thumbnails konvertieren

FOR %%b in (*.jpg) do convert “%%b” -resize x54 “thumbs%%b”

REM Bilder in die richtige Groesse konvertieren

FOR %%b in (*.jpg) do convert “%%b” -resize 665x360 “%%b”

==================================

and the batch call is:

imagebatch.bat directoryname

I think domino “tries” to use the convert command from W2000?

If I use the command with the directory info like c:\programs\imagemagick\convert , then it works…

… but that makes my batch almost impossible… at least for me :slight_smile:

Uwe

Subject: RE: problem with shell in LS agent called from web

ok, so if it’s getting the windows convert program first, why not set a local path in the batch file that has your convert program first? ie;

==================================

REM Ordner “thumbs” anlegen

chdir %1

IF not exist thumbs mkdir thumbs

SETLOCAL

PATH=DRIVE:\PATH\TO\CONVERT\PROGRAM;%PATH%

REM Bilder in Thumbnails konvertieren

FOR %%b in (*.jpg) do convert “%%b” -resize x54 “thumbs%%b”

REM Bilder in die richtige Groesse konvertieren

FOR %%b in (*.jpg) do convert “%%b” -resize 665x360 “%%b”

ENDLOCAL

==================================

highly likely if you call this from within the domino server then it’s going to kick in with whatever system variables a service gets, which is probably not a lot, and definately not what you’ve got when you’re logged in.