| Author |
How to determine where program was called from
|
|
| Paul Van House 2005-05-03, 5:52 pm |
| Our ERP system (QAD) has a primitive email interface that is able to
call an external program with command line switches (parameters.) Their
recommended e-mail program (wmailto) is OK but it often fails without
error messages.
I have written a "plus" version which works except for one problem.
QAD sends the mail message "body" as a text file, and stores the text
file in the folder defined in the QAD icons "Start in" Folder. The mail
interface itself builds a batch program...also in the "Start in" folder.
The batch program calls the Plus app, but Plus cannot find the text
file.
Is there any way I can get my "plus" application to find what folder
it was called from?
Example,
mail.bat is located in c:\temp
when run, mail.bat calls q:\qadmail\qadmail.exe (the Plus application)
How can I get Plus to realize it was called from c:\temp
I can hard code this, but some people have different "start in" folders
for various reasons.
--
Paul Van House
(remove _removeme_ from mail address for e-mail replies)
Radio/TV software and baseball statistics software:
http://www.binxsoftware.com
Family Home Page: http://www.binxsoftware.com/vanhouse
Church Home Page: http://www.ashfordumc.org
| |
| David Kerber 2005-05-03, 5:52 pm |
| In article <MPG.1ce184575a99e18a9896a0@news.dbase.com>,
pvanhouse_removeme_@houston.rr.com says...
....
> Example,
> mail.bat is located in c:\temp
> when run, mail.bat calls q:\qadmail\qadmail.exe (the Plus application)
> How can I get Plus to realize it was called from c:\temp
>
> I can hard code this, but some people have different "start in" folders
> for various reasons.
Can you pass it on the command line:
....
call q:\qadmail\qadmail.exe c:\temp
....
--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
| |
| Paul Van House 2005-05-03, 5:52 pm |
| In article <MPG.1ce1940f696550d4989d12@news.dbase.com>,
ns_dkerber@ns_wraenviro.com says...
> In article <MPG.1ce184575a99e18a9896a0@news.dbase.com>,
> pvanhouse_removeme_@houston.rr.com says...
>
> ...
>
> ...
> call q:\qadmail\qadmail.exe c:\temp
> ...
>
>
>
Unfortunately I have no control over the command line. If we had source
code life would be much easier.
For now I've loaded every possible path based on our "standard"
installation to search for the file. So far so good...but I've only
tried it on my machine.
--
Paul Van House
(remove _removeme_ from mail address for e-mail replies)
Radio/TV software and baseball statistics software:
http://www.binxsoftware.com
Family Home Page: http://www.binxsoftware.com/vanhouse
Church Home Page: http://www.ashfordumc.org
| |
| *Lysander* 2005-05-04, 2:50 am |
| In article <MPG.1ce184575a99e18a9896a0@news.dbase.com>,=20
pvanhouse_removeme_@houston.rr.com says...
> I can hard code this, but some people have different "start in" folders=
=20
> for various reasons.
I don't know if this is applicable in your case:
1.) could you let the user write the name of his "start-in"-folder to a=20
..txt or .ini file? This could be read by your application.
If you are familiar with registry-entries and how to manipulate and read=20
them this would be even easier and better.
2.) how many start-in-folders does everybody have? How often does it=20
change? If answers are "1" and "never", put your qadmail.exe in the same=20
folder as the start-in-folder.
--=20
ciao,
Andr=E9
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~
European dBase-conference dBKonEurope on June 3rd and 4th
English spoken conference around different database-topics
::
Info here: www.dbkon.org
| |
| Bruce Beacham 2005-05-04, 7:48 am |
| Paul Van House wrote:
> Our ERP system (QAD) has a primitive email interface that is able to
> call an external program with command line switches (parameters.)
Presumably QAD stores each user's start-in directory. Can you see
where it stores this? Perhaps do a registry search on one user's
machine for the QAD entries?
Bruce Beacham
| |
| Ivar B. Jessen 2005-05-04, 5:54 pm |
| On Tue, 3 May 2005 13:52:16 -0500, Paul Van House
<pvanhouse_removeme_@houston.rr.com> wrote:
> I have written a "plus" version which works except for one problem.
>QAD sends the mail message "body" as a text file, and stores the text
>file in the folder defined in the QAD icons "Start in" Folder. The mail
>interface itself builds a batch program...also in the "Start in" folder.
>mail.bat is located in c:\temp
I am not sure what you mean by '... the folder defined in the QAD
icons "Start in" Folder".
Assuming that the QAD program has a shortcut on the users desktop and
the shortcut's property 'Destination' is pointing at a path
....\QAD.exe you should be able to find the full path with the code
below my signature.
It goes through all the shourtcuts on the desktop, looks for a
Target/Destination path containing the string "QAD" and returns the
Working/StartIn path. To use type '? getShortcut("QAD")' in the
command pane.
Ivar B. Jessen
//-----
function getShortcut(cName)
wsh = new OleAutoClient("WScript.Shell")
strSpecFolders = wsh.SpecialFolders("Desktop")
ad = new array()
adir(ad, strSpecFolders + "\*.lnk")
for i = 1 to ad.size step 5
lnk = wsh.CreateShortcut(strSpecFolders + "\" + ad[i])
if upper(cName) $ upper(lnk.targetPath)
retVal = lnk.workingDirectory
endif
next
return retVal
release object ad; release ad
release object wsh; release wsh
//-----
| |
| Paul Van House 2005-05-05, 7:48 am |
| In article <yliZUdIUFHA.1528@news-server>, bbeacham@beacham.no-
spam.co.uk says...
> Paul Van House wrote:
> Presumably QAD stores each user's start-in directory. Can you see
> where it stores this?
The "start in" is stored in the shortcut icon on the desktop. Not in a
database and not in the registry. I don't think there are any registry
entries for QAD itself, just the Progress Database.
--
Paul Van House
(remove _removeme_ from mail address for e-mail replies)
Radio/TV software and baseball statistics software:
http://www.binxsoftware.com
Family Home Page: http://www.binxsoftware.com/vanhouse
Church Home Page: http://www.ashfordumc.org
| |
| Paul Van House 2005-05-05, 7:48 am |
| In article <MPG.1ce28976fad1a70198975b@news.dbase.com>,
nobody@nowhere.com says...
> In article <MPG.1ce184575a99e18a9896a0@news.dbase.com>,=20
> pvanhouse_removeme_@houston.rr.com says...
> 1.) could you let the user write the name of his "start-in"-folder to a=20
> .txt or .ini file? This could be read by your application.
> If you are familiar with registry-entries and how to manipulate and read=20
> them this would be even easier and better.
I can do this but I prefer to automate it. If I can get it to work
without manual manipulation I can market the utility. If not it stays
in-house and I remain poor.
> 2.) how many start-in-folders does everybody have? How often does it=20
> change? If answers are "1" and "never", put your qadmail.exe in the same=20
> folder as the start-in-folder.
At our site there are 2-3 start in folders. I modified my app to load
an array with possible start in folders and it's working...but again
this makes it highly specialized to our site.
--
Paul Van House
(remove _removeme_ from mail address for e-mail replies)
Radio/TV software and baseball statistics software:
http://www.binxsoftware.com
Family Home Page: http://www.binxsoftware.com/vanhouse
Church Home Page: http://www.ashfordumc.org
| |
| Paul Van House 2005-05-05, 7:48 am |
| In article <oulh71lha1p946uk8v0l44k6g7fcspk1ii@4ax.com>,
bergishagen@it.notthis.dk says...
> On Tue, 3 May 2005 13:52:16 -0500, Paul Van House
> <pvanhouse_removeme_@houston.rr.com> wrote:
>
>
This will work at our site...Thanks!
--
Paul Van House
(remove _removeme_ from mail address for e-mail replies)
Radio/TV software and baseball statistics software:
http://www.binxsoftware.com
Family Home Page: http://www.binxsoftware.com/vanhouse
Church Home Page: http://www.ashfordumc.org
| |
| Ivar B. Jessen 2005-05-05, 5:57 pm |
| On Thu, 5 May 2005 08:08:47 -0500, Paul Van House
<pvanhouse_removeme_@houston.rr.com> wrote:
>In article <oulh71lha1p946uk8v0l44k6g7fcspk1ii@4ax.com>,
>bergishagen@it.notthis.dk says...
>This will work at our site...Thanks!
You are welcome.
Does this mean that you will not remain poor?
Ivar B. Jessen
| |
| Paul Van House 2005-05-07, 8:46 pm |
| In article <13dk7119l4mda7vojt43k1oaicicva1jb1@4ax.com>,
> Does this mean that you will not remain poor?
> Ivar B. Jessen
>
I think I'll still be poor....but at least respected by my employer.
--
Paul Van House
(remove _removeme_ from mail address for e-mail replies)
Radio/TV software on my home page
http://www.binxsoftware.com
Family home page:
http://www.binxsoftware.com/vanhouse
Church home page:
http://www.ashfordumc.org
|
|
|
|