Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
35%
Installation Wizard into new VRC
42%
Manual into existing VRC
3%
Manual into new VRC
19%
Total votes: 31

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 23rd May 2013, 21:58
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,287
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Executing commands in command prompt using Script

Hello,

I was just wondering if there is any way to execute commands in command prompt (Windows). I used app_start to start the command prompt but I need to know, how can I execute multiple commands thorugh command prompt.

Like, the command prompt will pop up and will execute a few commands and then will exit.

I know, we can directly call a bat file, but was just wondering if there is any way to execute the commands through script.
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
  #2  
Old 25th May 2013, 04:05
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,906
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Is there a reason to not use a bat file? That is the only way I know how to do it. Other than that the most I do is run one command at a time thru app_start.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #3  
Old 25th May 2013, 09:48
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,287
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Smile

Hi Mark,

Thanks for the response. Well, actually, I want to execute the commands on the basis of conditions, so I wanted to know, if I can pass the commands through app_start.

You said, you can pass the arguments through app_start. Can you share the code to execute a single command in command prompt? The second option I got is to call a vb script which will execute commands, but well, that will be a tedious way.
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
  #4  
Old 25th May 2013, 23:24
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,906
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
All I do is build the string that runs with app_start. So for example if a user runs a session with three reports then, based off the report - I would run excel report1macro, or excel report2macro, etc. So I basically build the command string based off user selections. We actually use tables to hold which session, which report and which macro to run. I am not sure that is what you are looking for.

Now what you could do is build a bat file, download it to the client and then execute it. Nothing special needed just open a tempfile, put in the commands you want, use server2client, then use app_start to run the bat file.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #5  
Old 26th May 2013, 07:01
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,287
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Hi Mark,

Thanks. That was a good idea. Now, I will tell you what I need. The problem is that I need to execute telnet commands which is like, if I execute a command, I will need to wait for a few seconds to execute next command and it doesnt work when I use a bat file.

My commands are like:-

telnet mail.my_mail_domain 25 | After this command I need to wait for 2 seconds and then I execute next commands which are :-

helo my_domain
mail from...
...

So, the problem is, when I use a bat file and write all these stuff, it executes 1st command line only.

If I call app_start again, I guess it will start a new window of command prompt and it wont work then.
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
  #6  
Old 27th May 2013, 18:52
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,906
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I see what you are saying. You are starting a telnet session and now need to send commands to it. I have never tried it, but can't you send telnet itself a command file(or script) to use? Seems to me there was a way to do this in UNIX, but I am not sure windows works the say way. Maybe something using windows command redirection.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #7  
Old 28th May 2013, 08:53
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,287
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Hi Mark,

Thanks again for the reply. Unfortunately, telnet is not supporting redirection. I have found a second way to do it. What I did, is created a VB script which has the commands and actions and I just called that script from command prompt. But the only problem remains is that I am not able to close the command prompt box at the client computer which pops up when I do app_start which will not be a bigger issue.

If it were just normal commands I would have called a bat file but its a telnet session, so bat file doesn't work with that.
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
Sponsored Links
  #8  
Old 10th December 2015, 15:20
Ivanus Ivanus is offline
Junior Member
 
Join Date: Sep 2014
Posts: 23
Ivanus is on a distinguished road
Baan: 5.0b - DB: MS SQL - OS: Windows Server
Hi,

do you still using the VB-Script? If yes can you show me how it looks like ?

Thanks
Reply With Quote
  #9  
Old 11th December 2015, 07:01
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,287
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
I got it from one of the forums. Don't remember the exact name but I believe there are many of them.

Here is one - http://www.makeuseof.com/tag/automat...nds-vb-script/

You can google and get it. Unfortunately I do not have it anymore as I found better ways to do the task I was looking to do. Can you explain what is your requirement?
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming Question mr_suleyman Tools Development 37 11th November 2016 08:14
Good Practice for storing 'external' source code in BAAN shah_bs Code & Utilities 1 30th July 2008 22:02
Executing Shell Script from LN6 Session uetdba Tools Development 2 31st December 2007 08:15
unix script not executing properly Eddie Monster Tools Development 7 19th January 2006 19:55
Executing Shell Script from Program Script v_chandra Tools Development 3 26th October 2005 07:57


All times are GMT +2. The time now is 11:55.


©2001-2017 - Baanboard.com - Baanforums.com