View Full Version : Run a Command upon an OK Click

09-09-2008, 07:36 AM
Hello Forum, :)

I am just wondering if anyone here could help me automate a backup scheme which I go through manually now. My PC is a Vista.

I have a whole directory to backup every week. In order for this folder to be copied properly, I have to make sure that the application that uses the directory is closed. Preferably, a pop-up window should prompt the PC user to close the application and, when OK is clicked in the window, the following command initiates.

xcopy C:\Users\akisame\AppData\Roaming\akiApplication C:\akiBackup /s /i

Is it possible to write up a single batch file to do all this? I am at a loss how to make a pop-up window and use an OK click as a trigger for another command in the language that command prompt understands (sorry for being inprecise but I don't know the name). I am using this cmd language because it is the only language I know that can access the Windows file system.

If there is a niftier language or an application that can do the same thing, I am more than eager to ditch cmd!

Thank you in advance from a programophobe... :o

09-09-2008, 09:16 AM
I guess, this can be achieved using Microsoft Visual Basic.

An example using Sendkeys (http://www.developerfusion.co.uk/show/57/)

An interesting article from lifehacker.com on data backup.
Point 9. Back up your computer automatically.' (http://lifehacker.com/5045790/top-10-home-automation-projects)

09-09-2008, 03:12 PM
Write a vbscript file instead of a batch file, you can still copy your files and you will have access to a bunch of other stuff including message boxes.