Hi Friends,
I need to run an rece1.exe file (from Navision) which fetches a text file and sends to another application. For that I used the following variable and code in menuitem's OnPush() trigger and tried to run it. It throws an warning while running it. I have attanched the warning that I get. Can anyone help me where I am going wrong?
Name DataType Subtype
------------------------------------------------------------------------------
WSHShell Automation 'Windows Script Host Object Model'.WshShell
WinStyle Variant
OnPush()
---------
IF ISCLEAR(WSHShell) THEN BEGIN
CREATE(WSHShell);
WinStyle := 1;
WSHShell.Run('C:\Program Files\WSFEV1\rece1.exe',WinStyle);
CLEAR(WSHShell);
END;
Thanks in advance,
Aravindh
Answers
http://www.mibuso.com/forum/viewtopic.php?t=12417
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
WSHShell.Run('"C:\Program Files\WSFEV1\rece1.exe"',WinStyle);
because you have a space in the path
You have to set current directory.
WSHShell.CurrentDirectory := 'C:\Program Files\WSFEV1\';
WSHShell.Run('"C:\Program Files\WSFEV1\rece1.exe"',WinStyle);
Thanks a lot. It worked for me.. \:D/