veyant
6th July 2004, 09:40
Hi guys,
I want to run a batch file (.bat MS-DOS) from the Baan session on click on a button . Is there any such command available in Baan which can help me in executing the batch file and the DOS commands written in batch file .
The OS I have is HP-UX.
thanks
Sandeep :D
Hitesh Shah
6th July 2004, 11:18
Create a user choice on session and call function app_start (of ttdllbw) with batch file .
it will serve the purpose.
lakoon
6th July 2004, 22:19
Hi
The code looks like:
ret.code = app_start("cmd /c YourBatchFile", "", "", "", "")
ret.code > 0 Process id
ret.code < 0 error code of system
/lakoon
veyant
8th July 2004, 06:34
I tried for the same with following code on user choice.
choice.user.o:
on.choice:
ret.code = app_start("cmd /c c:\windows\desktop\try.bat","","","","")
But while compiling it is giving me error Unresolved Reference to function app_start.
Is this function defined in any DLL or function library?
i checked DLL ttdllbw in my system but i didn't found it. is it required component. can anybody help me in this.
please help
Sandeep
lakoon
8th July 2004, 07:43
Hello
you can link the dllbw to the script with:
pragma used dll ottdllbw
The libary is located in the tools directories.
/lakoon
veyant
8th July 2004, 11:19
I tried now and it is compiled error free but i think it is not working properly as no file was transfered.
Actaully i have writen one bat file in MS-dos to upload a txt file to unix server. and if i run it from local PC it is working fine. But now thru this app_start command it shows me success but doesn't upload the file.
given below is complete code for user option button:
choice.user.4:
on.choice:
ret.code = app_start("cmd /c try.bat","","","","")
if ret.code > 0 then
message("Success")
else
message("failed")
endif
am i missing something. please help
thanks
Sandeep
lakoon
8th July 2004, 11:27
Hello vayant
Would you like to transfer the files to the baan server?
If yes, than you can use other functions of ttdllbw.
1. Transfer from server to client
long server2client( string source, string dest, long text.mode, [long progress.window] )
2. Transfer from client to server
long client2server( string source, string dest, long text.mode [, long rm.file] [, long progress.window] )
/lakoon
veyant
8th July 2004, 12:25
Can you explain some more on these two functions and their arguments.
I need to transfer file x.txt from c:\test to Unix Server in /tmp folder. what i should write.
thanks
Hitesh Shah
8th July 2004, 12:52
something like
ret = client2server("c:\test\x.txt","/tmp/x.txt",true)
3rd argument is text mode - true indicating ASCII transfer and false meaning binary transfer
4th optional - window id for progress window if u need . (I have not used and tested this arg)
veyant
8th July 2004, 13:09
thanks
it worked finally.