Page 1 of 1

How to get an IM command to the console and run?

Posted: 2013-07-12T11:44:52-07:00
by holden
I have a vbscript written that takes instructions from a table and generates an IM command. I need to now run the IM command automatically- I thought I had this solved using .bat files but that won't work. Any ideas? I understand that there is some wip code for v7 happening, but a solution is needed sooner than the release date. Thanks

Re: How to get an IM command to the console and run?

Posted: 2013-07-12T11:59:50-07:00
by snibgo

Re: How to get an IM command to the console and run?

Posted: 2013-07-12T12:13:47-07:00
by holden
I've tried that and many variations, and nothing works- it's a common theme that those commands do nothing in the threads I have read through (and I have tried probably 40 iterations of it). I think the big issue may be setting permissions, and to have loose permissions that allow .bats to run does not seem like a good idea. Is there an alternative to a bat file?

Re: How to get an IM command to the console and run?

Posted: 2013-07-12T12:40:05-07:00
by snibgo
I'm not sure what you are asking. But I don't know VBscript, so I probably wouldn't know the answer.

Pasting this into a file called test.vbs ...

Code: Select all

Set objShell = WScript.CreateObject("WScript.Shell")
Set objExecObject = objShell.Exec("cmd /c %IM%convert -version")
Do While Not objExecObject.StdOut.AtEndOfStream
  strText = objExecObject.StdOut.ReadLine()
  Wscript.Echo strText
Loop
... then typing "test.vbs" at the command prompt works for me.

(Note: IM is an environment variable that points to a location for convert.exe.)

Re: How to get an IM command to the console and run?

Posted: 2013-07-12T12:55:18-07:00
by holden
then typing "test.vbs" at the command prompt works for me.
The thing I am trying to avoid is typing into the command line, I would rather have some automation of that part (I know this isn't the ideal forum to ask but so far the search has been fruitless). Basically vbscript generates the IM command which then *poof* runs in the console. I may have to look into some 3rd party software for a hot folder utility

Re: How to get an IM command to the console and run?

Posted: 2013-07-12T13:07:53-07:00
by snibgo
Well, something has to kick off the process: an image file is dropped on to a file, or into a directory, or something else. The file could be a BAT, C program or (I suppose) a VBS. For a directory, you could have a daemon program in C that autostarted on power-up then did nothing until receiving an interrupt from a directory change.

But such mechanisms are not feasible from within IM, the subject of these forums.