Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Sep 2008
    Thanked 0 Times in 0 Posts

    Run a Command upon an OK Click

    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...

  2. #2
    Regular Coder
    Join Date
    Nov 2007
    Thanked 40 Times in 39 Posts
    I guess, this can be achieved using Microsoft Visual Basic.

    An example using Sendkeys

    An interesting article from lifehacker.com on data backup.
    Point 9. Back up your computer automatically.'
    Blog Charity:Water
    WhatisWrongWith.me/tagnu - Send me anonymous feedback.

  3. #3
    Rockstar Coder
    Join Date
    Jun 2002
    Thanked 328 Times in 324 Posts
    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.


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts