Hye,
Do you know how can I get the Folder where I'm executing the client (fin.exe or finsql.exe)?
If in one computer I have Two installations of Navision with the same version in two diferents folders:
c:\Program Files\Micorosft Business Solutions-Navision\Client 1\
c:\Program Files\Micorosft Business Solutions-Navision\Client 2\
How can I know wich Client has ran mi application?
I need to do this because I have one file saved in BLOB format in a Navision Table, and I need to export it (in runtime) in the Client folder.
So I need to know witch is the client folder, cause is possible that the instalation is not in the default path.
Any suggestions? :roll:
Thanks a lot!!
0
Comments
If you had a process ID, it would be possible to find the working folder or path to exe using a custom made Automation control.
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
RIS Plus, LLC
How about try to copy the executable from that location to a temp location and delete the executable and copy it back if you succeed.
One question I have though is why does he want to move it to Navision directory?
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Ara3n. Question is: how can you get the folder where the executable is located? You would put it in a setup table?
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Tramirez ... I think you almost have a solution.
=D>
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Write an programm with vb, c# or wsh (wsh / WMI should be do this) to analyse the processes. Serach in the processes for fin.exe or finsql.exe. When you found the programm, you can get the process properties (like installation folder) and send it back to navision (for example as stream)
see next post.
Regards
Code for WMI Script that you must call from Navision
Here the navision code
The DOS - Prompt you can prevent when you call the vbs with parameter (no window)
Regards
So, good night. My bed calls.
Oh, my head, some of this beers was bad :-(
Make to Shortcuts on your desktop.
First to Client one
Second to Client two
In first shortcut you insert parameter id=%userprofile%\Client1.zup
and in the second id=%userprofile%\Client2.zup
with commandline you can get the parameters.
If you found client1.zup your application runs from folder
"c:\Program Files\Micorosft Business Solutions-Navision\Client 1\"
if you found client2.zup your application runs from folder
"c:\Program Files\Micorosft Business Solutions-Navision\Client 2\"
Regards
With the last post:
How are you going to get from Navision which ZUP-file you're using?
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
How i going to get which zup file i'm using :?:
I use (F5) System \ Commandline <- gives the start parameter like database, server, company and id (id is the place where i store the zup)
Regards
Thanks!
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
As you can see, if you do not change the current directory, you can get the App folder through this. Because if you create shortcut for the .exe file, the default dir is the app dir.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.