Running Batch Files in VISTA

Discussion in 'Windows Vista General Discussion' started by Peeky, Jun 23, 2007.

  1. Peeky

    Peeky Guest

    ::I have a need to run a simple batch file that contains “copy”
    statements so that my important files are secured on a different medium.
    Within Vista, as far as I am aware, you can only run .bat files as the
    administrator. If you double click on a batch file it simply opens the
    program that is associated with it, like a text editor. There may be a
    way to change the association so that double clicking a batch file
    (.bat) will make it run. I tried to find this out but to no avail so I
    have written a VBScipt that does what I want.::

    ::You supply the files you want to copy, along with their target files,
    in a configuration file (.ini) which the VBScript reads. An initial
    check is performed to ensure that BOTH source (full file name) and
    target (drive) exists. The .ini filename is specified as a runtime
    parameter so that different ones can be used by the same VBScript.::

    ::An output file (.txt) is produced detailing which files were copied
    and their target destinations. This file is always produced and can be
    either appended to or created each time the script is run. The only
    interaction between the user and the VBScipt is an error message if
    during running a problem arises.::

    ::The VBScript has been compiled to an .exe file and if anybody is
    interested I will gladly let them have it for FREE, along with detailed
    instructions on how to run it.::

    ::I have been using this now for three weeks and it works fine but any
    comments would be appreciated.::
    Peeky, Jun 23, 2007
    1. Advertisements

  2. Currently using XCOPY in a batch.
    If you would send the compiled *.exe I would love to try it out.
    DefecTalisman, Jun 23, 2007
    1. Advertisements

  3. The thing is my batch file is run via a autorun.ini which is directed to
    browsercall.exe and then the batch. So when ever I plug my USB backup drive
    in it asks me weather I want to back up, if answered yes it automatically
    backs up any newer files and folders. I wrote it so it is backward
    compatible to any OS that supports the USB drive. Also the batch has links
    to almost every system function in vista and xp. Never tried running it out
    of admin though. I know some system commands wont work unless in admin
    account. But XCOPY and COPY should.
    DefecTalisman, Jun 23, 2007
  4. Peeky

    Peeky Guest


    Thank you for your interest. If you email me on:
    will send you a zip file. This will give you enough information o
    running my program. Let me know how you get on and by the way how do yo
    run .bat files
    Peeky, Jun 23, 2007
  5. Run them in admin. Never tried out of, am off to give it whirl and see what
    I can come up with.
    I modified my default settings for command console so that it appears full
    screen on my comp with a bigger frame buffer.
    Did you notice the revival of "CHOICE" in vista? Buggered if I will use it
    due to none backward compatibility with XP. Rather stick with my
    set CHOICE =
    set /p choice=

    (NB: underscore not space, underline seems to
    make underscore invisible)
    DefecTalisman, Jun 23, 2007
  6. I don't have any problems running .bat files. I just double-click them or
    open a command prompt and run them from there.

    Are you sure the extension is right? If you leave the file extensions for
    know file types hidden (the default) the file will look like a batch file
    but the real name will be foo.bat.txt and you won't be able to see the .txt.
    In an explorer window go to organize->folder options->view and uncheck "hide
    extensions of known file types".

    I really wish Microsoft didn't do this as a default. It causes a lot of
    confusion and even helps spread email viruses because people think they have
    a .txt file attachment when it is really a .txt.exe file. They just can't
    see it because the real extension is hidden.

    Beverly Brown, Jun 23, 2007
  7. To true.

    DefecTalisman, Jun 23, 2007
  8. Peeky

    Peeky Guest

    Beverly Brown,

    What if you want to schedule the .bat file
    Peeky, Jun 23, 2007
  9. Autorun.ini or Autorun.inf?

    Personally, I prefer not to have automatic processing of Autorun.inf,
    as many malware use this to infect USB sticks, etc.

    Instead, I'd prolly use a QuickLaunch shortcut (easy access, no matter
    how cluttered the desktop) to run the utility, so it can operate on
    any out-the-box USB drive etc. I can then set that shortcut to run as
    admin, if need be, and I'm not affecting other PCs [*1].

    If knowing which drive letter to copy to is a problem, then you can
    "seed" your USB stick with a marker file that the batch file can seek.
    Build a variable with detected letters, then...
    - if none, prompt
    - if one, use that
    - if > one, list and prompt

    [*1] If you visited me with a USB stick that autoran something when
    plugged into my PC, I'd prolly chase you away with another stick :)

    Tech Support: The guys who follow the
    'Parade of New Products' with a shovel.
    cquirke (MVP Windows shell/user), Jun 24, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.