Catch the executable call before running it - operating-system

I am trying to develope something in windows that can catch the call of executive files before running it. The aim is to launch analyses on the executable and then execute it if the analyse is good or don't run it if the analyse is bad.
I have alrdeady tried to use the Register keys with the option "Debugger" to launch a different executable, but I don't know if there is a methode to generalise it to every executable files (except some importants) and i wasfacing some trouble with the rename of executable files...
I thought also to develop a Driver but this seems little bit long and hard so I want to be sure that a Driver can actually do my wishes (and if you know how to develop a Driver with only one computer, I would be happy to see your way :) )
So tell me what are you thinking? Have you some other way to do it or not? :)
Thank you for your time!!

Related

What code should I use? sys.exit() or some other thing I haven't found?

I'm a high school student in a class that is using Python 2 on Enthought Canopy Windows Edition. I often get stuck in coding loops, but the only way I can get out is by closing out all forms of open Enthought. Is there any more reliable way to do it? I've been using sys.exit(0), but it doesn't work correctly, and is leaving my coding in a jam. I can't even test it without it getting me stuck. Anyone know how to fix this issue?
If your code is already running, then you can't reliably type a command to stop it, because the prompt won't necessarily be live then.
Often you can use the Run menu's "Interrupt kernel" command, and you should usually be able to use "Restart kernel", though this doesn't work all the time.

Precompiled applescript service?

I have created an automator service for my finder which runs an applescript. I will have to use this service incredibly often. I have noticed that after running the service, there is a very large (about ten second) delay before I receive any popups from the script. This is far too long. I am almost positive this delay comes form automator compiling my script every time it is run....
So, I have a question -- is there a way to pre-compile an applescript, then install that applescript as a finder service? Going through automator was the simplest way I could think of to install my script as a service, but if there is a better way -- particularly one that pre compiles my applescript, that would be great.
I'm not sure if it's a "compiled" issue. I see long delays sometimes too, even with compiled scripts. Automator actions are run by the "automator runner" application and applescripts are run by the "applescript runner" application (unless they're created as stand-alone applications). I notice sometimes that during the first launch that it takes extra time but on subsequent launches it acts faster... maybe because the runner applications are up and running during subsequent runs. So I'm more likely to believe it's something in the runner applications rather than the script itself.
However you can run a "compiled" script if you wish. Just create the script as a separate file. Then in the applescript portion of your automator action use this...
run script file "path:to:script.scpt".
With that being said, you can even create the applescript as an application and then run that from automator...
tell application "MyApplescript" to activate
Maybe one of those solutions will help speed it up for you. If you do achieve a speedup, please let us know.

Script that runs itself every now and then

I work in marine systems institute. We have a buoy that sends information about the sea every few hours to a central computer in the institute. It drops it as a .txt file in a certain folder. It would be really great if I could make a script that looks into that folder every 3 hours and checks if there are any new files. If there is a new file, it should upload it to an ftp.
I have no idea where to start. Are there any suggestions what language, where to look, what to search etc.
The computer is running 24/7 and the script can easily be an executable that is active all the time. The script doesn't have to restart itself every time, it can be up and running 24/7 also.
Thanks in advance
EDIT1: My op.sys is windows
If your platform is Windows, I suggest Windows Forms Application. An IDE is available, Visual Studio - it is easy to use and has everything you need for your application. You basically need a timer object that will execute a function (checking the file) in a certain interval. 3 hours is long enough, you can even check it every 5 min.
AutoHotKey can be learned by anyone in a day, and is powerful enough to do what you describe.
A program written in a real language could do exactly what you like with full customization, robustness, portability, and maintainability, but will take quite a bit longer to make.
It might be a little over your head if you never done any programming(Forgive me if you have).
A good solution is to use FileSystemWatcher http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx. Then create a windows service to run it.
But again that takes some experience implementing.
Try using an ftp client such as smartftp which can watch the folder where the files are created, and automatically upload them.

Making and Interfacing with Custom Services

I've been searching for this for awhile now, and I am not sure if I am just not using the correct search terms or if the answer is really that hard to find.
What I am trying to do is to create a new Windows service for a game server from a batch file, and then have a task run another batch file every 30 minutes or more that would run two commands on the game server's command line and do some file work.
Specifically, I am running a Minecraft server using Bukkit for a gaming community I help run, and I want to make sure that the thing is always up unless I specifically tell it to stop (like a service). Bukkit is run directly from a batch file and has it's own command line thing running on it.
I am told that you CAN run this type of thing as a service, but the command line will be hidden from view and/or interaction. This is the second part of my query. I have a handy little backup.bat file that copies all the world files and userdata files into a backup directory, 7zips it, and deletes the directory. The only thing is, is that Minecraft likes to always have the worlds' region files open and writing at all times, meaning that it could cause map corruption if I just run it straight off. To compensate, I need to run the command "save-off" on the server to disable the file hooks temporarily, run the backup, and as soon as it finishes, run "save-on" so that the game can continue without lost data.
What I would like to know about this second one is, is it possible to interface with the game service through a batch file, or do I need to create an application to do that? If the latter, how exactly does one go about doing that? I have moderate C++ knowledge (up through my second OO-C++ course in college), and can possibly learn another language if absolutely necessary.
So, in short, two questions:
1. Is it possible to, and how to run a BAT file as a Windows Service?
2. How to interface with said service via BAT files, and if not possible, what kind of application do I need to write (redirection to or writing a tutorial works for me).
Thank you in advance for any and all help!
Old question, user account doesn't seem active on SO anymore, but hey, if you stumble upon this because you have a similar problem:
Since we are speaking about a Bukkit Minecraft server, turn to the "Essentials" plugin for Bukkit.
It now includes a Backup function that does exactly what the OP asks for, namely stop the save so the files can be manipulated without corruption, launch a script, then starts again.
The script can be a backup one (examples provided in the linked page) but can be used to run any operation on the world's files.

Is it possible to run a VBA form as a .exe file

Is it possible to save a form in VBA as .exe file and then run it.
No, not natively.
There are some ways to emulate an EXE:
Excel: 3rd party tool that claims to be able to compile an workbook to an EXE: DoneEx XCell Compiler. You can also create an automatic marco, Auto_Open, to run when the workbook is opened.
Access: Microsoft used to have a way of delivering an Access database as an executable (the name of the tool escapes me) so you could deploy your database to desktops that didn't have Access installed, but I don't think they offer this anymore. You could convert you MDB to an MDE and set the startup properties to hide the database window and menus and such to emulate an EXE, but your users will need to have Access installed.
Word: You can pass the /m switch to Word on startup with the name of a macro to run.
I think there is at least 2 way
move the code into visual basic 6 and compile it or use visual studio tool for office and see what you can do.
if these 2 solutions is a no no for you, then you are out of luck
No. VBA is an addon to applications to support "scripting" in the form of VB.
So unless your application supports a way to save the internal script as en external EXE, you are out of luck.
I think DoneEx still needs Excel installed, it just bootstraps something to the xls file, or bootstraps that to something and wraps it up as an exe???/..
as I think this does.
http://cpap.com.br/orlando/XLtoExeMore.asp
But at least the second one if free!
I have not tested on PC's with out office.
what is it you are trying to accomplish there may be a work around another way?
thanks
Ross