I would like to know if is possible to run a *.bat file in a Windows server using connect direct from mainframe. I don't know if I use a RUN TASK or a RUN JOB or which command to use or how can I start this *.bat file.
If does anybody know how to do please send me solution please.
If I was not clear please reply that I will try to explain again !!
Oh, I almost forgot... I tried this command below but I does not have success (The SNODE was defined before in signon process):
STEP1 RUN TASK (PGM="TEST") SNODE -
SYSOPTS=\'CMD(G:\\TSTFOL\\TST\\TEST.BAT) DESKTOP (YES)'\
Joined: 26 Apr 2004 Posts: 4650 Location: Raleigh, NC, USA
The Run Task statement calls external programs to run on a Connect:Direct node. The Process waits
until the external program completes before continuing. When the external program completes, the
Run Task returns a completion code that indicates program success. This completion code can be
used by subsequent Process conditional statements.
The Run Job statement executes external programs or commands to run on a Connect:Direct node.
These programs run concurrently with the Process. Unlike the Run Task statement, the Process does not wait for the program to finish.
When the Run Job statement completes, it returns a completion code. This completion code
indicates the success of the Run Job statement, and not the success of the program or command.
My personal preference is to not use either, but to rely on the job scheduling system to handle such a task. Since you want to run a command, from what I know, RUN JOB is your only option.
First I would like to thanks Mr. Superk for the support and his idea...
Superk I read your message but I did the solution with another way...
Well I will Explain what I did.
I used a RUN TASK and it works fine.
First I asked to Windows responsible to configure the proxy from his side to accept my user to run the process in the windows side (This is necessary or you do not have access to run anything there).
Second I used the PGM instead CMD and did a different command as I will show below:
RUN TASK (PGM=WINNT) -
I saw in C:D guide that is necessary to know if the windows is 95 or NT in my case the windows is a windows server, but it is not a problem because windows server is like a Windows NT, this is to explain the use of the parameter (PGM=WINNT) if it was windows 95 the parameter should be (PGM=WIN95).
In the parameter SYSOPTS I used as parameter only the name of the ".bat" file once that the path just configured previously in the server.
the SNODE were configured previously in the SIGNON defining with the main path of the server in my case is a website ("SNODE=TCPNAME=WEBSITE.COM HOLD=NO").
Well I think that's all.
I hope that all this explanation has been helpful.