>>> I'm a newbie at programming and I'm trying to write a program that
>>> allows me to count the number of times a program is accessed with
[quoted text clipped - 6 lines]
>> What program is used to open the file when the user double-clicks its
>> icon?
When you reply, please include enough context so that someone can read
the post from top to bottom and follow the conversation.
> I created a .exe from vbs script (i tried this language first as like
> i said im new to programming) and assoitiated the .exe with all pdf's
> the problem was that my script only includes the command to run adobe
> and not pass the selected file info
Since this is a Java news group, I can't really help with the actual
code here unless you want to try solving the problem in Java. If you
really want to stick with VB, try posting your code in a VB-related news
group.
It sounds like your program is getting invoked whenever the user opens a
relevant file (PDF), so your program can do whatever it likes when that
happens. In order to keep a count of the number of times the program
has been invoked, your program might include the following steps:
- try to open a config file for read/write, e.g.
%HomeDrive%%HomePath%\_yourProgramRC
- read the count from the file if it is present, else initialize
the count to zero
- overwrite the file contents with the new count, i.e. the old
count plus one
- run adobe, passing it the relevant command-line arguments and
process environment
The current count will always be stored in the config file.