Trying to trigger a .cmd to run on the MIDServer with no success....

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2011 11:22 AM
I am trying to use the ECC queue to trigger a .cmd to run on my MIDServer with no success. I am using the wiki article "http://wiki.service-now.com/index.php?title=Borland_Starteam_Integration" as a guide. I can manually go to the server and run the .cmd, and it works perfectly, but I can't insert an ECC Queue entry successfully like shown in the UI Action of this article. I realize that the article is running a .js file and I'm trying to run a .cmd, but I would think it should still work. I removed "cscript" from the entry since I am not running .js, but still no success. Below is my ECC Queue Code:
//command to run
var cmd = 'c:\\scripts\\psprinter2xcopy.cmd ';
//create a new ecc_queue record
var queue = new GlideRecord('ecc_queue');
queue.initialize();
//where to process
queue.agent = 'mid.server.' + midServer;
queue.topic = 'Command';
//script to execute
queue.name = cmd;
queue.source = 'UI Action';
queue.queue = 'output';
queue.state = 'ready';
queue.insert();
}
Thanks for any help...
Jason

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2012 03:37 PM
The Community Forum got pretty ugly when you pasted that XML. If you wrap it in code tags like HTML but using square brackets [ code ] and [/ code ] instead, but remove those spaces I used to make it literal. then you will be able to paste the actual XML:
<sys_id state="processing">476bd21784db90400d1e060476e97b7b</sys_id>
You'll see that it says it is still processing. Which means that the MID server must be doing something. Can you find any sign of the CMD running on that machine?
I'll admit this will be difficult to troubleshoot over the community and may warrant some time spent on web conference session(s). Do you have an outstanding contract with a partner or are you working with ServiceNow Professional Services?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2012 03:57 PM
I did not realize that. But now that you explain I guess I should have known not to paste the code. So the record shows in state of processed - I guess I assumed that meant it was actually processed....
No I see no signs at all. I've been pretty much clicking my test button then immediately switching over to the server to see if anything is happening. I've opened the command prompt beforehand, watched the event logs on the server, and everything else I know to even see a sign that it is running.
We aren't currently working with anyone on this one. It's pretty much something I've been trying to do as a way to do some very simple tasks without using RBA. I know that's what we need, but were not sure that the budget will allow it at this time. I may run it by my manager and se what he thinks about getting a couple of hours of your time. It may be worth it. Thanks for the help.
Jason

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2012 08:59 AM
Also reach out to support on the HI instance if no one else on the community can help or think of something we are missing here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-05-2015 01:56 PM
Did you have it resolved eventually? I also run into a similar case recently.
- I was told that the executable command "msend.exe" is compiled based on java code thus need JVM to run it.
- The command can be executed on MID server without problem (remote connect to MID to kick it off)
- When use OOTB "Command" probe to drop it to ECC queue and then being executed on MID remotely, the command would be crashed.
- Using same "Command" probe for other Windows default command, works fine.
- Using it for this msend.exe, it's being executed and then crashed. (Windows event log indicated it)
- Both remote and local case were tested by using the same service id
- The concern is MID is using JVM to handle ServiceNow task, while this msend.exe is also using JVM thus some what causes incompatibility.