Automating tasks in Windows 7

26
2013-08
  • Daniel Fath

    I need some help automating some tasks in XP. Most of them are of console nature. Now in Linux this probably wouldn't be too difficult to pull off but I'm not too acquainted with Windows automation capabilities. There are couple of scripts I need. I presume there are ways to script this in Windows 7 using Microsoft-DOS but I'm unsure. Just to be clear I'm merely listing what I would need to be done, so you know what feature set I require, I'm not asking to write scripts for me.

    Script #1
    1. Zip folder
    2. Add the rest of the folder including the previous zip into SVN.
    3. Open Zip and overwrite some folder.

    Script #2
    1. Copy file to a specific folder
    2. Execute that file in a browser

    So what tool would allow me to automate these tasks?

  • Answers
  • Andrew Moss

    The inbuilt Task Scheduler will allow you to do all that easily (I'm presuming you know how to write simple batch scripts?). In Windows 7 it's accessible through Administrative Tools.

  • EBGreen

    If you expect to be automating windows on a regular basis (or even if not really) it would probably be worth the effort to learn Powershell. It is the scripting language that MS plans to move to for automation. Most current MS products (including Operating Systems) already support it and MS has committed to making as many future products as possible support easy automation via Powershell.


  • Related Question

    automation - Automating keystrokes and actions in Windows
  • Jonathan Parker

    I want to be able to either record key strokes or enter them in manually and be able to replay them.

    For example:

    Copy

    1. Manually highlight the text I want to copy.

    2. Ctrl+C

    3. Alt+Tab
      Manually position the cursor where I want to paste the text.

    4. Ctrl+V

    5. Alt+Shift+F10

    6. T

    This would allow me to copy text into MS Word and set the formatting of the text.

    Are there any tools for this?


  • Related Answers
  • mutewinter

    AutoHotKey can be used to make hotkeys that do what you want. It even has a recorder to ease the process of creating your script.

    Here's a quick example I threw together based on what you're trying to do:

    ; The X, Y coordinates inside your target window to click for pasting
    targetX = 0
    targetY = 0
    
    !^v::
    {
    Send, {CTRLDOWN}c{CTRLUP}{ALTDOWN}{TAB}{ALTUP}
    WinWait, Microsoft Word, 
        IfWinNotActive, Microsoft Word, , WinActivate, Microsoft Word, 
        WinWaitActive, Microsoft Word, 
        MouseClick, left,  %targetX%, %targetY%
        Sleep, 100
        Send, {CTRLDOWN}v{CTRLUP}
        Send, {ALTDOWN}{SHIFTDOWN}{F10}{SHIFTUP}{ALTUP}{SHIFTDOWN}t{SHIFTUP}
    }
    

    This script makes Ctrl + Alt + V a hotkey that executes the above script.

  • raspi

    Check out AutoIt

  • Bruce McLeod

    You can automate anything with windows, it just depends on what your needs are and your skill level.

    As recommended autoit is probably the entry level of a category of tools that leads up to full blown commercial automation tools which are primarily used for testing applications.

  • pgs

    You can do basic macros (recorded keystrokes & delays) with a Logitech G15 keyboard.

  • Joe Schmoe

    I've been using Macro Express for this sort of thing for years.

    Good software, never had an issue with it - not free though.