Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. IT & Infrastructure
  4. Automatically execute a batch file upon selecting the Save As option

Automatically execute a batch file upon selecting the Save As option

Scheduled Pinned Locked Moved IT & Infrastructure
helptutorialquestion
3 Posts 3 Posters 11 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ASPnoob
    wrote on last edited by
    #1

    Hi All, Is there a way to automatically execute a batch file upon selecting the Save As option? What I'm trying to do is I'm trying to prefill the File Name box using a batch file. Suppose after creating a text file I go to the file option and select Save As. Upon selecting the Save As option, the batch file executes and populates the File Name box that pops up with a name that was predefined, skips a space, and adds the current date to the end of the file name. For example if I specified the file name to be automatically generated as MyFile and today's date is January 1, 2010, after the batch file executes, the name of the file will be MyFile 010110. Thanks in advance for your help.

    D 1 Reply Last reply
    0
    • A ASPnoob

      Hi All, Is there a way to automatically execute a batch file upon selecting the Save As option? What I'm trying to do is I'm trying to prefill the File Name box using a batch file. Suppose after creating a text file I go to the file option and select Save As. Upon selecting the Save As option, the batch file executes and populates the File Name box that pops up with a name that was predefined, skips a space, and adds the current date to the end of the file name. For example if I specified the file name to be automatically generated as MyFile and today's date is January 1, 2010, after the batch file executes, the name of the file will be MyFile 010110. Thanks in advance for your help.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      If you're talking about doing this in any app, then no, you can't. There is no special event that says a FileSave dialog is going to show up and no way a batch file can supply or alter the information (file list) that the dialog displays. What you're talking about has to be written into the application that you're trying to modify.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008
      But no longer in 2009...

      D 1 Reply Last reply
      0
      • D Dave Kreskowiak

        If you're talking about doing this in any app, then no, you can't. There is no special event that says a FileSave dialog is going to show up and no way a batch file can supply or alter the information (file list) that the dialog displays. What you're talking about has to be written into the application that you're trying to modify.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008
        But no longer in 2009...

        D Offline
        D Offline
        dawmail333
        wrote on last edited by
        #3

        Or... use AutoHotkey[^] to write a shortcut, so you can press a combination on your keyboard, and have it automatically fill it out. Quite a handy tool, you'll want to read the manual though. Bloody good idea. I've got a script set up with a quick hotkey to bring the script up in the editor, and one to refresh the script, allowing very quick changes. Awesome stuff! :)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups