Navision Filepath

Big_DBig_D Member Posts: 207
Hi Mibuso Community

Is there a way to know where Navision is running from, i.e., if run from C:\Navision\Fin.exe then I want to know that it was run from C:\Navision or if run from E:\Navision\Fin.exe then I want to know that it was run from E:\Navision?

Thanks for your help as always :D !

Cheers
Big D signing off!

Comments

  • garakgarak Member Posts: 3,263
    if u use Nav >= 5.0
    message(APPLICATIONPATH);
    

    Regards
    Do you make it right, it works too!
  • garakgarak Member Posts: 3,263
    ah forgott to post the solution, if you are us NAV <5.0
    Name	DataType	Subtype	Length
    WSHShell	Automation	'Windows Script Host Object Model'.WshShell	
    
    CREATE(WSHShell);
    MESSAGE('%1',WSHShell.CurrentDirectory);
    

    regards
    Do you make it right, it works too!
  • Big_DBig_D Member Posts: 207
    Hi Garak

    Thanks for the reply yes it was a 3.70 version I required. I found IWshShell3 in Windows Script Host Object Model - presumed it was one and the same for an XP m/c! What OLE do I need to register to run your lovely code?

    Cheers and thanks
    Big D signing off!
  • Big_DBig_D Member Posts: 207
    Hi Garak

    Remembered that I have used that Automation ('Windows Script Host Object Model'.WshShell) for setting function keys and obtaining the windows currency so I just used your routine in the same codeunit and bingo - all works great thanks :D !

    Never understood why Navision remembers a registration in one object but doesn't allow the same Automation routine in another new instance!

    Cheers and thanks

    David
    Big D signing off!
  • Big_DBig_D Member Posts: 207
    Hi Garak

    Am on a roll today - found wshom.ocx in C:\WINDOWS\system32\ and this had the actual WshShell which works in all objects now - hurrah :D !

    Thanks
    Big D signing off!
Sign In or Register to comment.