Hi all, I know that there a lot of topics about similar kind of issues but I did no find a solution to myself.
So my problem is the following: I want to start an outside *.bat file which opens a cmd screen and start a procedure that takes about 6-7 sec. So when I start this file from Navision using SHELL - it actually run the file but didn't wait it to finish with the procedure and close the cmd screen immediately and nothing actually happen.
I tried several ways of starting SHELL (full path, short path), use a SLEEP after the SHELL but no success.
Please can you help me with this issue.
P.S. I am using SQL database with Navision 5.01 client
Thank you!
0
Comments
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I tried every type of the showing the screen but still as soon as press the button( from where I start DosShell) the screen appear for a second and then dissapear with nothing done.
Have you tried running another bat file from Navision?
You can also try adding a Pause command to the last line of the bat file. This way it will wait until you press a key to finish the process.
Pargesoft
Yes when I ran the bat file it all goes well but when I start it from Navision it don't do anything.
But this paused that you tell me to put let me find the reason for the problem. It was in the bat file. It starts another .exe and the problem was that in the directory of the .exe in the bat file a 'cd' was missing and it couln't find it, and when I start it from Navisoion there was a problem. Nevermind.
Thank you
Thanks
WSH is an Automation variable of type 'Windows Script Host Object Model'.WshShell
The RUN method allows you to change parameters for WindowStyle and WaitOnReturn.
I am trying to run a batch file from MSD NAV using 'Windows Script Host Object Model'.WshShell (based on Kirki's function)variable but in vain.
The command is as follows
RetournValueAsInteger := DosShell('C:\abc.bat',1,TRUE);
Please help me to resolve the problem.
Regards,
Ani
Aniruddha
Why are you not calling Run or Exec?