WshShell & Nav Backup

logu_cbelogu_cbe Member Posts: 54
Hi,

As one of our client wants automated backup with in Nav, i am using WshShell as follows

WinShell - 'Windows Script Host Object Model'.WshShell

CREATE(WinShell);
WinShell.SendKeys('%(t)');
WinShell.SendKeys('b');

It works fine but while i am trying to Use "send keys" further (To type file name and description), i cannot proceed in that.

I can really appreciate any kind of inputs in this.....

Thanks,
Logu

Comments

  • kinekine Member Posts: 12,562
    It is because the dialog is modal and it means no C/AL code is running behind. Try to send all keys in one command to buffer them and end the code...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • logu_cbelogu_cbe Member Posts: 54
    Thanks for reply...

    I tried in that way also. But failed. ](*,)
  • ara3nara3n Member Posts: 9,256
    Hello Logu_Cbe

    With the automation, you need to take pause in order to send messages. So either use a timer or pause for a second.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • logu_cbelogu_cbe Member Posts: 54
    Hi Rased,

    Thanks for your reply....

    I cannot fix that issue in SLEEP (Pause) also.

    I can really appreciate for other inputs...

    Thank you,
    Logu
  • WaldoWaldo Member Posts: 3,412
    Well, I think you'll have to do it from outside NAV. It's like Kine said: the modal form messes things up for you. If you can call the sendkeys from outside NAV, the modal form won't have this influence on the external app ... .

    May be you can call a seperate exe from within NAV? Not sure if this is a seperate process though ... :-k . You will have to do some testing.

    Some little voice in the back of my head says to me that ExpandIT (http://www.expandit.com/) has something like that.

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
Sign In or Register to comment.