Page 1 of 1

Calling another file from a .bat file issue

Posted: 13 Oct 2009 08:53
by pattere
In my company's check printing process, which has been altered, we need to call a batch file on a server to run from another server.

Here's the gist of the process:
1. Checks are sent from our ERP system to the printer.
2. The check formatting/processing application is polling the system for the file(s), and grabs them.
3. The raw data is processed into our specific format to be printed.
4. All the processed data is then sent to the printer, and to another server to be archived via an imaging system.
5. Here's the issue--A batch file on the first server is used to call a batch file on the imaging server to process the the data into images.

Here is the the file used to call the remote .bat:
cd ..\..\
cd "Program Files\PSTools"
psexec \\imagenow \\imagenow\e$\inserver6\script\RTS_ImportChecksAndUpdateCheckNum.bat

**psexec is a part of pstools to run processes on remote systems.

If I run this .bat manually, the .bat file runs correctly on the remote server.

If someone has an idea about getting this to run the remote process, please let me know. If there is a better way to script it, I am open to that as well.

Posted: 15 Oct 2009 05:05
by gianniiiii
Hy Pattere, have you tried using CALL o START?

Example

call psexec \\imagenow \\imagenow\e$\inserver6\script\RTS_ImportChecksAndUpdateCheckNum.bat

or

start psexec \\imagenow \\imagenow\e$\inserver6\script\RTS_ImportChecksAndUpdateCheckNum.bat


Max

Working on that

Posted: 15 Oct 2009 13:07
by pattere
I am looking into using a CALL or START. I do not mess with this kind of thing very often, so it may take a little work to get it to work.

The psexec command is what I was using to call the remote .bat file. I have tried this:

CALL \\imagenow\e$\inserver6\script\RTS_ImportChecksAndUpdateCheckNum.bat

It did not seem to work. I need to put a pause in it to see if it is throwing an error.

Re: Working on that

Posted: 16 Oct 2009 01:03
by gianniiiii
pattere wrote:I am looking into using a CALL or START. I do not mess with this kind of thing very often, so it may take a little work to get it to work.

The psexec command is what I was using to call the remote .bat file. I have tried this:

CALL \\imagenow\e$\inserver6\script\RTS_ImportChecksAndUpdateCheckNum.bat

It did not seem to work. I need to put a pause in it to see if it is throwing an error.


Hy pattere, so it should be a permission Issue. check wich user launch the batch.

I Mean, if you have a scheduled task check if the user that launch the task is a user enable to act over imagenow server.