When triggering a UBE filter to run an external batch file, it doesn't work, although the rule is triggered.

UBE filters are not running a batch file as
an external program. The batch file is located in the postoffice spool
directory and has the correct permissions.
<P>
Change the RUN command to REJECT to check that it was actually triggered.
<P>
<B>Background:</B>
<P>
Example:
<P>
filter.cfg is as follows:
<P>
:Test Channel-To "ecxpert@host\.domain\.com" RUN "test.bat"<BR>
:sendback Channel-To "ecxpert@host\.domain\.com" COPY "pvtest1@host\.domain\.com"
<P>
filter.opt is as follows:
<P>
# To parse header fields as well as envelope fields remove the comment (#) from the following<BR>
# line. See Help for more information<BR>
parseheader:1
<P>
test.bat resides in C:\Netscape\Suitespot\MailServer\Spool and is as follows:
<P>
date /t >> test.txt
<P>
This would be 100% correct for any Unix system, with the addition of a top line
to the script determining what shell to use. However, with NT, shell type
definition is not part of a batch file.
Correcting the UBE filter in filter.cfg to read as follows cures the problem:
<P>
:Test Channel-To "ecxpert@host\.domain\.com" RUN "cmd.exe /c test.bat"
<BR>
:sendback Channel-To "ecxpert@host\.domain\.com" COPY "pvtest1@host\.domain\.com"
<P>
The following also works:
<P>
:Test Channel-To "ecxpert@host\.domain\.com" RUN "cmd.exe /c date /t test.txt"<BR>
:sendback Channel-To "ecxpert@host\.domain\.com" COPY "pvtest1@host\.domain\.com"
<P>
The reasoning behind this is that batch files are scripts for CMD.EXE, the
NT Shell, and therefore cannot be executed directly. CMD.EXE has the /C
switch to run a following command, or batch file, and exit on completion.
<P>
Another solution would be to write an executable program in BASIC or any
other chosen language to perform the same functions. However, do compile it to an
executable before trying to use it since, for example, a *.BAS file will
run in Windows but it means nothing to Messaging Server.

Look at the documentation of Runtime.exec()
There are versions of that method that allow you to specify the name of an executable (the name of your batch file) and also an array of strings with environment parameters. I've never used this myself, but it should work like this (lookup the documentation!):
Runtime.getRuntime().exec("bla.bat", new String[] { "ROOTDIR=" + rootdir });

Similar Messages

  • Running executable in batch file as administrator when UAC is high

    Hi Team,
    I have a requirement of running executable in batch file by passing the current windows login username as parameters. Below is the content of my batch file:
    cmd /c start setup.exe http://testsite:7001/mobile  %username%  %username%
    But, when the UAC is set high in windows 7 machine, this executable is not running properly, and giving me warnings. And, if I am running the same start command after opening command prompt as administrator, then executable is running smoothly.
    So, is there any way I can run the executable as administrator by giving some options in batch file, when UAC is high?
    I tried runas option, but its prompting for admin password, which we can't provide as users will not know.
    Do we have some option in batch file as 'Run As Administrator' right click option, where it doesn't prompt for password but run the file with admin privilege?
    Thanks,
    Tina Soni

    Hi,
    When using Runas command, you can add a switch option /savecred
    /savecred will make it ask for admin password on the first run only, after that it should be saved
    Yolanda Zhu
    TechNet Community Support

  • How to run an external .exe file from an indesign pluging

    Hi,
          Suppose if I have written an separate application in C++ (.exe file) & need to run it from an indesign pluging(as if a service in windows). have you provided that facilities in your SDK? if it's please let me know how to run an external .exe file from a indesign pluging.
    Thanks,

    I'm actully writing data in PMString to a external txt file.
    another question..
    if i want to execute an action when the ok button is cliked how can i do it?
    whe i add a button(widget) i know how to handle it. please see my code.
    // Call the base class Update function so that default behavior will still occur (OK and Cancel buttons, etc.).
    CDialogObserver::Update(theChange, theSubject, protocol, changedBy);
    do
    InterfacePtr<IControlView> controlView(theSubject, UseDefaultIID());
    ASSERT(controlView);
    if(!controlView) {
    break;
    // Get the button ID from the view.
    WidgetID theSelectedWidget = controlView->GetWidgetID();
    if (theChange == kTrueStateMessage)
    //if (theSelectedWidget == kEXTCODGoButtonWidgetID
    switch(theSelectedWidget.Get())
             case kEXTCODGoButtonWidgetID:
      this->ViewOutput();
      break;
             case kEXTCODFindButtonWidgetID:
      this->SaveLog();
      break;
    // TODO: process this
    } while (kFalse);
    I do two actions "SaveLog" & "ViewOutput()" using two buttons. But i dont know how to execute an action when the ok button is clicked...

  • Irregular delay while running a dos batch file using a servlet class

    i used RunTime( ) class to execute a dos-batch file containing some commands like changing the directory, running an exe(executable.exe) file...etc in a servlet class. while this servlet class is invoked, the exe file(executable.exe) is run after irregular delay at different trials.
    Note: When this batch file is run in a stand alone java class, it is working fine.
    what can be the possible cause of this prob? Help me in this.

    It's ok - I've found the answer.
    I'll post it here for anyone else who is interested.
    The problem stemmed from the fact that I had to put the path to javaw.exe in quotes, as the batch file is dynamically generated from the user's environment, and then run. The user's system properties gives a path to java home using a full path name, which WinNT/Win2K doesn't like.
    The following batch file content solves it, closing the DOS box after starting javaw.exe. Before this part of my batch file, there is just some file copying that goes on for the autoupdate process.
    set PATH=%PATH%;"D:\Program Files\JavaSoft\JRE\1.3.1\bin"
    start /B javaw.exe -Dmyapp.home=C:\myapp myapp.client.MyAppClient subSys
    exit
    The parameter subSys is just a command line parameter that MyApp.java looks for, so not relevant for everyone.
    /B prevents a second DOS box from opening.
    exit simply closes the DOS box once the javaw.exe process has started.
    Too easy! Although I can't believe how difficult it was to find information about this. Hopefully it will be of benefit to others.

  • My work computer runs Outlook 2003, which I know will not work with the iCloud, so I hard sync.  But then the new info on my iPhone does not backup to iCloud.  Is there a solution?

    I have a Macbook and iPhone and like to back up to iCloud.  However, my work computer runs Outlook 2003, which I know will not work with the iCloud.  The company has no plans to update anytime soon.  Since the calendar and contact list on my office computer are my primay ones, I hard sync through iTunes.  The problem is that any data synced from Outlook 2003 to the iPhone from iTunes does NOT later backup to iCloud.  Is there a solution?

    I have the same problem with Outlook 2003 and Win XP which the multinational organisation I work for standardises on and will probably stay with forever!

  • Junk mail filter doesn't work all the time

    Why doesn't the Junk mail filter work all the time? I click on mail like from Best Buy or Omni Hotels to go into junk mail but hardly any of their mail goes into Junk. Other sites go directly to Junk. If I click on a Best Buy mail to indicate it's Junk, shouldn't that work 100% of the time forever and ever?

    The Junk filter is based on an analysis of the content of the message. It ignores the sender. (Filtering based on the sender is an ineffective way of dealing with true spam, since spammers use constantly-changing spoofed addresses.)
    If you don't want mail from a legitimate sender like Best Buy, unsubscribe from their ads. If that doesn't work, make a Rule to delete or move the messages.

  • Iam from Yemen we have CDMA carrier called Yemen mobile I bought an iPad from the US CDMA works with Verizon when I got to Yemen doesn't work with the carrier Yemen mobile and  both carriers verizon and Yemen mobile work by the CDMA system don't know whey

    Iam from Yemen we have CDMA carrier called Yemen mobile I bought an iPad from the US CDMA works with Verizon when I got to Yemen doesn't work with the carrier Yemen mobile and  both carriers verizon and Yemen mobile work by the CDMA system don't know whey can anyone help me please..

    A Verizon-model iPad can only work on CDMA with Verizon. You cannot use it with any other carrier. Apple, to my knowledge, has not released the iPad in Yemen, so there is no iPad you can use with any carrier there that works only on CDMA. You would need to find a GSM carrier and then get an unlocked GSM iPad.
    Regards.

  • When i convert a word file with a hyperlinks to a PDF file it doesn't work ?? thanks in advance for helping me

    when i convert a word file with a hyperlinks to a PDF file it doesn't work ?? thanks in advance for helping me

    using microsoft word.
    the hyperlink doesn't work in the pdf file (adobe reader).
    adobe reader xi.
    my operating system windows 8.1.
    the attached screen is appeared.

  • How To Run An External .exe File With Command Line Arguments

    Hiya, could anyone tell me how I can run an external .exe file with command line arguments in Java, and if possible catch any printouts the external .exe file prints to the command line.
    Thanks.

    Using the Runtime.exec() command. And read this:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • TS1398 What would be the reason why when i try to connect my iphone to a wifi server; it doesn't work? It also doesn't pick up any wifi connections.

    What would be the reason why when i try to connect my iphone to a wifi server; it doesn't work? It also doesn't pick up any wifi connections.

    go to settings>general> reset network connections  and then try again

  • TS3992 How can I back up an iphone when I haven't set the phone up for back ups & the touch screen doesn't work? The phone can receive calls (not answer) & the pictures & messages can be seen but touch screen doesn't work to unlock the phone or select any

    How can I back up an iphone when I haven't set the phone up for back ups & the touch screen doesn't work? The phone can receive calls (not answer) & the pictures & messages can be seen but the touch screen doesn't work to unlock the phone or select anything. We want to save/transfer pictures, contacts, and music to the replacement phone.

    Try backing it up to your computer with iTunes.  Connect it to your computer, open iTunes, click on the name of the phone in iTunes, go to the Summary tab of your iTunes sync settings and click Back Up Now.  Also go to File>Devices>Transfer Purchases to transfer you apps and other purchased media to your iTunes library.

  • TS4079 I have an iphone 5 and my Siri doesn't work at the moment. But when I restart my phone it works but 5 minutes later it doesn't work again!!! What should I do???

    I have an iphone 5 and my Siri doesn't work at the moment. But when I restart my phone it works but 5 minutes later it doesn't work again!!! What should I do???

    Try reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.

  • My keyboard doesn't work from the login screen, but when I login as a guest user it works fine (minus the brightness buttons, playback buttons, etc.).

    I've already switched out the batteries and the keyboard works fine, so I fear it might be some sort of bug? All the methods of restarting or resetting certain settings can only be done from the login screen or from within an account, when the keyboard doesn't work, and the guest options are limited to non existent.

    Try doing a SMC reset, you may need to do this 2-3 times as sometimes the reset doesn't always "take" the first time. To do a SMC reset, shut down the computer, unplug the power cord from the wall and computer, wait 15-20 seconds and restart normally and test. If after 2-3 resets it still does not work test another keyboard. If that keyboard works then this indicates your keyboard has failed and needs to be replaced.

  • Running a windows batch file on the middle teir

    Hi, I am converting a client/server Forms app to 10iAS (9.0.4). in Client Server mode, one of the forms calls a batch file that runs on the client. The same batch file must now run on the middle teir app server where iAS is installed, not the client's computer (no need for WebUtil).
    No change was made to the batch file, and it can be run with supplied params at the command prompt on the iAS server. However, when run through the web app, the batch file is failing. It is being executed, but when it hits this line:
    FOR %%F in (%1\arp*.w) do type %%F | gawk -f ARKeys.awk | gawk -f SMSar.awk
    it fails.
    Q: is there a different method to program DOS batch files wheb being called from the Forms server?

    Hi, I am converting a client/server Forms app to 10iAS (9.0.4). in Client Server mode, one of the forms calls a batch file that runs on the client. The same batch file must now run on the middle teir app server where iAS is installed, not the client's computer (no need for WebUtil).
    No change was made to the batch file, and it can be run with supplied params at the command prompt on the iAS server. However, when run through the web app, the batch file is failing. It is being executed, but when it hits this line:
    FOR %%F in (%1\arp*.w) do type %%F | gawk -f ARKeys.awk | gawk -f SMSar.awk
    it fails.
    Q: is there a different method to program DOS batch files wheb being called from the Forms server?

  • Run Form using Batch file

    Hiii
    how can run a form using batch file (.bat) .. .
    ???

    i forget to say that am using Developer 10g R2 ...
    another question is what should i start when using the batch file other than the
    OC4J instance .....

Maybe you are looking for

  • "A disk on [computer] is in use and could not be ejected."

    Yesterday I was doing a few things and needed to connect to my desktop iMac (running Tiger). When I did I was surfing through the applications folder on that computr when I accidentally opened iTunes. It did open, so I quit it. Anyway, then I ejected

  • Can't export song files in Hydrogen drum program

    Well; I'm having audio problems again, so today I added my user into the audio group with: su usermod -a -G audio wordstrings which eliminates the "permission denied issue" Then went: [wordstrings@DTR-Arch-Linux ~]$ hydrogen Hydrogen 0.9.5.1 [May 5 2

  • Bars on blueray

    bars on screen top and bottom of picture on new  blueray player . is that normal and how do i get full picture. have new panisonic 50 in plazma Solved! Go to Solution.

  • Events don't change

    new problem with iCal. when i change an event, both events stay. there is some poor interaction with iCal as well. if i set an event and then drag and drop it to another date, both stay there. if i delete, it comes right back, usually when i go to an

  • Volume settings for my ipod

    How do you adjust the volume for this ipod? I can't seem to adjust it. Please help.