Jump to content
Macro Express Forums

How best to remote trigger


Recommended Posts

I’ve messed with this from time to time and used various solutions all which seemed to work OK but I was wondering how others do it and was looking to grade and discuss the various possible methods. In the past most of mine have been a single need but now I’m looking at the possibility of several.

 

In the environment of a small office network on might have a slave machine that performs various laborious macros in a session where the user will not be interrupted. Mostly this machine runs them on a schedule but in some case I’d like other macros on other machines to command these to run. Often it will be a user who wants to rerun an audit report generator but in some case it might also be an automated macro. EG a macro that uses a list might check the date of a list and decide it’s time to refresh it.

 

Job File Drop: One method I have used was to have the user PC’s macro drop a file in the folder of the slave. Then the macro on the slave machine would have an activation watching for mods to the folder and delete the file and run. TO accommodate multiple macros and prevent accidental execution I was thinking I could make the contents of the file be the name of the macro I want to execute. That could be read into a var and have a single remote control macro that would then run whatever macro was in that file.

 

Telnet: I experimented with using Telnet at one point back in the ME3 days but that’s too difficult and requires all the machines and firewalls be se t up to handle Telnet. But still I like the idea of some sort of remote execution via a command prompt or something. Maybe there’s some VBScript kind of thing one could use.

 

Single job file method: The idea that’s tops in my mind at the moment is some sort of job file, perhaps INI, where I would not only receive remote commands but could also track progress. EG I could have a line for each macro in the INI and when the remote user runs their macro it would modify a network folder INI file to change the status to “Run” or something. Then once the Slave starts the job it could change the status to “Running” then later to “Finished”. So not only could the user command they could see status. Also one might be able to do things like sending the user an alert when the macro is done. One thing I don’t like about an INI in this case is that there’s not repeat command to run thru all the values. Also the activation is less than elegant because if I put it in a folder with a lot of other files I cannot isolate activation to just that file so any of the files being modified might trigger it.

 

Windows Messaging: I experimented with Net Send once and use Window activation but now with the chance that other macros might be running that could interfere.

 

Does anyone have any comments or other ideas?

Link to comment
Share on other sites

Job File Drop: One method I have used was to have the user PC's macro drop a file in the folder of the slave. Then the macro on the slave machine would have an activation watching for mods to the folder and delete the file and run. TO accommodate multiple macros and prevent accidental execution I was thinking I could make the contents of the file be the name of the macro I want to execute. That could be read into a var and have a single remote control macro that would then run whatever macro was in that file.

This is by far my preferred option. Any file dropped in your target folder would result in one specific control macro (as sophisticated as you want to make it) being run which could do pretty well all the things you list in your email, as long as its child macros were all set up to understand any settings it might make (probably in the registry). I'd also like to see the id of the user being included in the request, plus date and time, and even possible directives on how to handle certain errors. The control macro could then handle all reporting of the outcome (back to the originating user if appropriate).

Link to comment
Share on other sites

I like a variant on your job file drop. But it could be a single file, where each line in the file represents a job. Job (macro?) name would be one field of each record. Include a position in each record of the file for a status code: e.g. new, in-progress, complete. You could easily enqueue on the job (macro) name if you need to prevent the same job from running more than once simultaneously. Add date and timestamps for creation, job-start, job-end, etc. to whatever degree is useful. Pass parameters from the initiator to the macro if necessary. You can be as simple or as fancy as you want in the design. You will probably wind up with a set of common macros that will check and post conditions to the job file, and either call or be called by the macros that perform the business functions.

 

In other words, pretty much a standard interface or queuing system, where one or more systems put items on a queue, and one or more other systems dispose of the items. A single job file, on a network share available to "everybody" is simple as long as the loose security is not too much of an issue.

Link to comment
Share on other sites

Yeah the more I thought about it the more I think this would be the way to go. Conceptually simple to manage and I could pass options like whether to notify the requesting user when complete and even pass their email address and such. I think this is the Tack I'll take.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...