moncheris
13th February 2003, 00:44
How do I call a cmd/bat file from Baan server? The cmd/bat file is located in c:\tmp\XXX.cmd. Actually I need to run some window scripting on the NT server which the batch file actually states the command 'cscript c:\tmp\runfile.vbs'.

I try using
process.error = run.prog("cmd.exe", "/C c:\tmp\XXX.cmd", RP_WAIT)

and

process.error = run.prog("c:\tmp\XXX.cmd", "", RP_WAIT)
and this doesn't work either.

Both examples above don't work.

Also try directly giving the command
process.error = run.prog("cmd.exe", "/C cscript c:\tmp\runfile.vbs", RP_WAIT) and this doesnt work either.

All give me a process.error > 0.

Any help will be appreciated.

Thanks!

shah_bs
13th February 2003, 02:45
I think the PATH variable needs to be set for the cmd.exe program for run. Alternatively, give the full path name for the command.

moncheris
13th February 2003, 22:16
Originally posted by shah_bs
I think the PATH variable needs to be set for the cmd.exe program for run. Alternatively, give the full path name for the command.

Have been using the following command for FTP function and it works. The only problem now is calling the batch file.

process.error = run.prog("cmd.exe", "/C ftp -s:c:\ftpcmd.dat 192.168.0.1", RP_WAIT)