Link to home
Start Free TrialLog in
Avatar of Don OHara
Don OHara

asked on

app that saves output files as they are generated.

I now use an app that generates a 'work' file each time its run. The work file is always generated with the same treename.  Now I run a new program that will process a set of the 'work' files... But only if I remember to save&rename each 'work' file before running the app.

So I am interested in a new program that runs continuously on Windows( 7&10) that checks for a new version of the work file (pauses/sleeps for 30 seconds, then checks ) .  If this program finds a new work file, the program copies the file to a particular directory, and removes the work file from the app's directory.

I would have this program start up when Windows is started.  This program would retrieve its parameters (treename of target work file and the save directory) from a 'INI' type file. The name of the INI file would be a command line argument or queried to the user.. All INI files are stored on one base directory This allows me to have 2 or more instances running at the same time.

Are there scripting languages that run on Windows?  If not, my computers do currently have Python running.

Thanks,
Don OHara
Avatar of Joe Winograd
Joe Winograd
Flag of United States of America image

Hi Don,

> Are there scripting languages that run on Windows?

Yes...many! You've already mentioned Python. Others are AutoHotkey (my personal favorite), AutoIt (AutoHotkey is a fork of AutoIt), Windows batch files (.bat), Perl, PowerShell, REXX (my fav until I discovered AutoHotkey), Ruby, VBScript, and plenty more. Regards, Joe
Avatar of Don OHara
Don OHara

ASKER

Which can be used natively on Windows - without any installation issues? And would do what I want?

Thanks Joe.
Hi Don,

> Which can be used natively on Windows

Of the ones that I listed, Windows batch files, PowerShell, and VBScript are included natively with Windows.

> without any installation issues

Well, even though PowerShell is installed with Windows, I've seen it cause grief for some users due to the ExecutionPolicy issue. A Google search on that will get you all you need to know about it, and here's an interesting article that discusses it:
How to create and run a PowerShell script file on Windows 10

> And would do what I want?

I'm sure that PowerShell and VBScript can do it (and maybe batch files in the hands of the right expert, such as Bill Prew). But I'm not an expert in any of them, so best to wait for other folks to jump in. I could do it in AutoHotkey, but that's not built into Windows. However, one advantage of AutoHotkey is that it has a compiler that can produce a stand-alone EXE file that can run on any system without AutoHotkey being installed. To be clear, it's not a "compiler" in the traditional sense...it does not generate object code for your script...rather, it packages the AutoHotkey interpreter and your script's source code into the EXE file. That said, it works a charm! Regards, Joe
Hi Joe,
Your comments are very interesting.
Sounds like AutoHotkey is versatile (once it is learned). I am looking at the Website now- most likely will download it.
Being an EXE file, I should be able to run multiple instances (using different INI files to track different files). As long as I can choose the sleep time, this should not hinder computer performance.

Thoughts?

Thanks, Joe
I am reading the user guide now.
Is it possible to send me an AutoHotkey script that does this task.

Thanks, Don
> Sounds like AutoHotkey is versatile

Yes, AutoHotkey is a very robust language, including native support for COM (Component Object Model) calls.

> Being an EXE file, I should be able to run multiple instances (using different INI files to track different files).

Yes, but be sure to set #SingleInstance to Off, documented here:
https://www.autohotkey.com/docs/commands/_SingleInstance.htm

> As long as I can choose the sleep time

No problem...Sleep doc here:
https://www.autohotkey.com/docs/commands/Sleep.htm

> Is it possible to send me an AutoHotkey script that does this task.

Sure, it's possible...everything in your initial post is doable with AutoHotkey, although I don't yet know how long it would take to write (and test on both W7 and W10). Is this a project for work where you have a budget for developing the program or are you looking to have it developed pro bono?

I'm leaving my office now for a few hours. Will check back into the thread as soon as I return. Regards, Joe
Hi Joe,
Thanks for responding.
I am doing this for myself. I am the one who occasionally forgets to save a file so the my second level review is missing files.

I prefer to write this myself to learn Autohotkey. I always like to learn new tools.
My request to you was for a simple sample for me to use to learn.
One that would not take long to put together. even if only on W-7.

Thanks, Don
Hi Don,
Sorry I didn't get back to this today. It's on the to-do list for tomorrow. Regards, Joe
ASKER CERTIFIED SOLUTION
Avatar of Joe Winograd
Joe Winograd
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks Joe.
I will work at this right after Thansksgiving.

You have a great holiday.

Don
You're welcome, Don. You have a great one, too...and safe travels, if you're travelling. I'll be with family for the holiday and likely won't be on Experts Exchange until Monday, but I'll check back into the thread then to see how you're doing. Regards, Joe
Hi Don,

I'm back from my Thanksgiving holiday with family...had a great time...hope your Thanksgiving was good, too.

Do you need further help on this question? Regards, Joe
Hi Joe,
I apologize for not being around to reply.
Just got back myself from an extended trip.
I will follow up very soon.
Don
Welcome back! I hope your trip was a good one. I'll be here during the next several days to help if you need it. Regards, Joe
The key to my question was for me to learn about the best robust scripting language for my particular situation, and Joe is an 'expert' in that. I have developed scripts and will continue to do more.

Thanks, joe
Will stay in touch.
You're welcome, Don, and thanks to you for writing the very nice Testimonial...much appreciated!

I also appreciate that you selected one of my posts as the ASKER CERTIFIED SOLUTION, but I'd like to make a suggestion on that. The post where I said "Welcome back! I hope your trip was a good one..." is not really the "solution". The post with the article/video references and the sample code snippets is the "solution"...this post: #a42986725

I think it would be far better for this thread to make that post the "solution". Regards, Joe

Update: Thanks for making the change!