Shell-Substitute "Oyster"

AdministratorAdministrator Member, Moderator, Administrator Posts: 2,500
edited 2011-01-30 in Download section
Shell-Substitute "Oyster"
Substitute for Navision-internal "Shell"-Command.
Prevents warning messages in Navision 4.0

Register it, make a suiting variable (Oyster) and use it like:

cmd:='notepad.exe';
if Oyster.Oyster(cmd) then ...;

You have to used a text variable (cmd), passing constant text will raise an error.

http://www.mibuso.com/dlinfo.asp?FileID=492

Discuss this download here.

Comments

  • toennetoenne Member Posts: 38
    there's a discussion in

    http://www.mibuso.com/forum/viewtopic.php?p=22170

    showing a better way to prevent from warning messages by using the MS-Shell :oops:
  • aodaod Member Posts: 54
    Sorry for my Question - maybe I am a little bit stupid.

    I have registered the oyster.ocx.

    How do I have to define a Variable "OYSTER" ?

    Thank you !
  • toennetoenne Member Posts: 38
    aod wrote:

    How do I have to define a Variable "OYSTER" ?

    In the form "C/AL Globals" or "C/AL Locals" you add a new line variable with

    Name = Oyster
    Data Type = OCX
    and in column SubType you pick "Oyster.OysterCtl" from the lookup list.
  • aodaod Member Posts: 54
    toenne wrote:
    aod wrote:

    How do I have to define a Variable "OYSTER" ?

    In the form "C/AL Globals" or "C/AL Locals" you add a new line variable with

    Name = Oyster
    Data Type = OCX
    and in column SubType you pick "Oyster.OysterCtl" from the lookup list.

    Thanks,

    But I don't have the Data-Type OCX ?!
    Is it avaiable at a Report or only at CodeUnits ?
  • toennetoenne Member Posts: 38
    aod wrote:
    toenne wrote:
    aod wrote:

    How do I have to define a Variable "OYSTER" ?

    In the form "C/AL Globals" or "C/AL Locals" you add a new line variable with

    Name = Oyster
    Data Type = OCX
    and in column SubType you pick "Oyster.OysterCtl" from the lookup list.

    Thanks,

    But I don't have the Data-Type OCX ?!
    Is it avaiable at a Report or only at CodeUnits ?

    OCX are available in all types of objects. it might be restricted by licence??
  • aodaod Member Posts: 54
    Many Thanks,

    I Think this is the problem - so we have to spend more money !!
  • Timo_LässerTimo_Lässer Member Posts: 481
    You need the granule 1750 Tools - C/OCX
    Timo Lässer
    Microsoft Dynamics NAV Developer since 1997
    MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
  • svensk.tigersvensk.tiger Member Posts: 31
    Up to 3.70 I wrote shell('net time /set /yes'); to sync the clients time.

    In 4.0 Sp1 the %PATH% will be ignored and the net.exe not found!!!

    I have to change it to shell('C:\Winnt\system32\net.exe ',' /set /yes');

    Assuming, windows ist alway installed in C:\winnt, what is not true.
    So the environment variable %SystemRoot" has to be determined.

    Because of the short flashing up of a black CMD-Window, we use a similar
    OCX automation server, wich gives us the possibility to hide the window.

    To avoid the problems, that could rise with not registered OCX's, we have
    merged it in the Navision client installer MSI.
    Svensk.Tiger (Henning Möller)
    PASS Multibank Solutions AG
    (Kaum macht man was richtig, schon geht es. / Once you do it right, suddenly it works.)
  • krikikriki Member, Moderator Posts: 9,112
    Up to 3.70 I wrote shell('net time /set /yes'); to sync the clients time.

    In 4.0 Sp1 the %PATH% will be ignored and the net.exe not found!!!

    I have to change it to shell('C:\Winnt\system32\net.exe ',' /set /yes');

    Assuming, windows ist alway installed in C:\winnt, what is not true.
    So the environment variable %SystemRoot" has to be determined.

    Because of the short flashing up of a black CMD-Window, we use a similar
    OCX automation server, wich gives us the possibility to hide the window.

    To avoid the problems, that could rise with not registered OCX's, we have
    merged it in the Navision client installer MSI.
    You can use
    SHELL(ENVIRON('windir') + '\system32\net.exe','/set /yes');
    
    or also ENVIRON('SystemRoot')
    For all evironment-variables, open a dosbox and enter 'SET' as command. You will see all environment-variables.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • svensk.tigersvensk.tiger Member Posts: 31
    Thats true,

    but your have to find and modify all your shell calls before going to 4.x.
    Svensk.Tiger (Henning Möller)
    PASS Multibank Solutions AG
    (Kaum macht man was richtig, schon geht es. / Once you do it right, suddenly it works.)
  • krikikriki Member, Moderator Posts: 9,112
    Thats true,

    but your have to find and modify all your shell calls before going to 4.x.
    Not necessary, the shell calls that are always the same, you don't need to change. You give permission to run it once, and next time he won't ask permission anymore ... until you use it on another computer or delete your zup. (Can't remember if it is saved in the zup or in the registry). So better change it anyway.

    Finding them is not so difficult: export all objects as text and search for 'SHELL'.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • What would be really great, to have a method to return stdout from the application.
  • krikikriki Member, Moderator Posts: 9,112
    zehnan wrote:
    What would be really great, to have a method to return stdout from the application.
    If I understood correctly what you want:
    In the DOS-command, put "c:\..\MyCommand.exe > c:\temp\MyFile.txt"
    This to save the stdout of the DOS-application into a file.
    Then open the file in Navision and read it.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • dick11dick11 Member Posts: 60
    I want to use oyster to convert a file to another before I continue in NF.

    How can I set oyster that he waits for the command to be ready (like it is in WaitVar := SHELL('notepad.exe'); )?
    Dick van der Sar

    www.dasautomatisering.nl
  • krikikriki Member, Moderator Posts: 9,112
    I don't know if it is possible with oyster, but there is another method:
    Check out this http://www.mibuso.com/forum/viewtopic.php?t=6204
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • dick11dick11 Member Posts: 60
    Yes I used that in the beginning.

    Then I noticed that Windows 2000 has no "'Windows Script Host Object Model'".

    So I am searching for a Shell that workes with NF 4 without asking permission and wait's until the command is finished and also workes with Windows 2000.
    Dick van der Sar

    www.dasautomatisering.nl
  • krikikriki Member, Moderator Posts: 9,112
    dick11 wrote:
    Then I noticed that Windows 2000 has no "'Windows Script Host Object Model'".
    :shock:
    I created a function that uses that automation when I still was working on W2K.
    Which service pack of W2K do you have? I had SP4.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • dick11dick11 Member Posts: 60
    My test PC has SP3. But is a Server. Does that matter?

    I have currently no normal W2K PC so I cannot check that.
    Dick van der Sar

    www.dasautomatisering.nl
  • krikikriki Member, Moderator Posts: 9,112
    dick11 wrote:
    My test PC has SP3. But is a Server. Does that matter?

    I have currently no normal W2K PC so I cannot check that.
    A server should be better than a normal one.
    But it is possible that SP4 makes the difference.
    But before you install that, I advice to check it out on another PC.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • dick11dick11 Member Posts: 60
    OK I found a SP4: Same problem.

    Any other ideas?
    Dick van der Sar

    www.dasautomatisering.nl
  • krikikriki Member, Moderator Posts: 9,112
    Try to install all fixes for W2K you can find.
    BTW:Did you check OCX or automation? It is an automation.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • krikikriki Member, Moderator Posts: 9,112
    I created a Tip and Trick-topic on how to use the Shell of "Windows Script Host Object Model".
    See http://www.mibuso.com/forum/viewtopic.php?t=12417
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • dick11dick11 Member Posts: 60
    Thanks.

    If have tried this again. And yes it workes with XP. But it still does not work at our W2K PC's.
    Dick van der Sar

    www.dasautomatisering.nl
  • krikikriki Member, Moderator Posts: 9,112
    I checked the MS site:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/9d24095d-46a2-44d7-b900-fd4a0497a314.asp
    Under "What is WSH" it is written that it should also work on W2K.

    I am getting out of ideas of what the problem could be on your W2K-pc's.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • dick11dick11 Member Posts: 60
    Thanks ...

    So. Has someone else an idea?
    Dick van der Sar

    www.dasautomatisering.nl
  • SGanzmannSGanzmann Member Posts: 1
    Hallo,

    Oyster is working fine in Windows XP =D> , but I cannot register oyster.ocx on a Windows 7 64 bit computer ](*,) .
    Can someone please help, thank you.

    Regards
    SGanzmann

    \:D/ I have it: It is working, but it is not so easy to register the OCX-file:
    You have to register it in winndows/syswow64 and you have to deactivacte user controll \:D/
Sign In or Register to comment.