Results 1 to 14 of 14
  1. #1
    Lounger
    Join Date
    Feb 2010
    Location
    Boston, Massachusetts, USA
    Posts
    29
    Thanks
    0
    Thanked 3 Times in 1 Post

    Running a .BAT file in Win7

    I'm trying to reinstall an application that returns an error code when doing so. A developer in the application's forum says to run a cleanup file he provides, but it's a .BAT file. The instructions for the file say that in Win 7 to run it as Administrator, but I can't get a "Run" or "Run as Administrator" option when right-clicking or Shift-right-clicking the file. Is there any way to run a .BAT file in Win 7?

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Plutonium Lounger Medico's Avatar
    Join Date
    Dec 2009
    Location
    USA
    Posts
    12,625
    Thanks
    161
    Thanked 928 Times in 851 Posts
    Try this method from How To Geek.
    BACKUP...BACKUP...BACKUP
    Have a Great Day! Ted


    Sony Vaio Laptop, 2.53 GHz Duo Core Intel CPU, 8 GB RAM, 320 GB HD
    Win 8 Pro (64 Bit), IE 10 (64 Bit)


    Complete PC Specs: By Speccy

  4. #3
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    5,957
    Thanks
    193
    Thanked 730 Times in 666 Posts
    You should be able to get the "Run as Administrator" by right clicking on the file in Explorer. If you don't you may be running with a limited account. Make sure you're using an Administrator account.

    Another thing you may try is to type Command into the search box on the start menu then right click the Command Prompt item in the results and select the "Run as Administrator" option then navigate to the file in the command window and run it from there.
    May the Forces of good computing be with you!

    RG

    VBA Rules!

    My Systems: Desktop Specs
    Laptop Specs


  5. #4
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    2,819
    Thanks
    19
    Thanked 108 Times in 102 Posts
    I've never tried Ted's suggestion, but I'm sure it works. Retired Geek's way is the more common.

    If your requirement to run this cleanup BATch file is just a one-off, then a further way is to click on Start, then on All Programs, then on Accessories, then right-click on Command Prompt, and click on Run as Administrator from the popup menu. As previously stated, you need to be using an Administrator-privileged account.

    If you need to run BATch files frequently, then there's lots of extremely valuable Stuff in this search on Seven Forums.
    BATcher

    If it wasn't for the weather, Great Britain would be a silent nation.

  6. #5
    Plutonium Lounger Medico's Avatar
    Join Date
    Dec 2009
    Location
    USA
    Posts
    12,625
    Thanks
    161
    Thanked 928 Times in 851 Posts
    Windows Seven Forums also shows a method to automatically add Run As Administrator to Right Click menus.
    BACKUP...BACKUP...BACKUP
    Have a Great Day! Ted


    Sony Vaio Laptop, 2.53 GHz Duo Core Intel CPU, 8 GB RAM, 320 GB HD
    Win 8 Pro (64 Bit), IE 10 (64 Bit)


    Complete PC Specs: By Speccy

  7. #6
    Lounger
    Join Date
    Feb 2010
    Location
    Boston, Massachusetts, USA
    Posts
    29
    Thanks
    0
    Thanked 3 Times in 1 Post
    Didn't work. Registry wasn't quite the same as example. HTG method from Vista, perhaps?

  8. #7
    Lounger
    Join Date
    Feb 2010
    Location
    Boston, Massachusetts, USA
    Posts
    29
    Thanks
    0
    Thanked 3 Times in 1 Post
    Was using an administrative account and should ahve mentioned that, but still no "Run as Administrator" in context menu. However, running from command line as Administrator did work perfectly and application did reinstall. Thanks.

  9. #8
    Lounger
    Join Date
    Feb 2010
    Location
    Boston, Massachusetts, USA
    Posts
    29
    Thanks
    0
    Thanked 3 Times in 1 Post
    Thanks. Retired Geek's second method did work, first didn't. Actually, I have a "Commend Prompt" icon on my desktop and that runs as an Admin just fine.

  10. #9
    Lounger
    Join Date
    Feb 2010
    Location
    Boston, Massachusetts, USA
    Posts
    29
    Thanks
    0
    Thanked 3 Times in 1 Post
    I just want to express my appreciation for the quick and useful replies to my request. The Lounge rocks!

  11. #10
    Bronze Lounger DrWho's Avatar
    Join Date
    Dec 2009
    Location
    Central Florida
    Posts
    1,216
    Thanks
    15
    Thanked 159 Times in 124 Posts
    I came to this topic from the Windows Secrets Newsletter, because it's something of great interest to me.
    I've been writing and running batch files, since I first learned how while running DOS 2.0 back sometime
    around 1980.
    I never have had any trouble running batch files in any version of Windows including Windows 7. I run
    them every day, to clean up the junk that Windows likes to hang on to and to backup data files to a second
    hard drive, update a Utilities Flash Drive, etc.

    So when someone (anyone) says that they can't run a batch file, it peaks my interest as to "Why?".
    What's different between that person's PC and my own?

    I have found two Registry Scripts that perform similar functions and add a LOT of functionality to Windows Vista
    or Windows 7. The first one "Take Ownership" everyone should have heard about by now, maybe not so much the
    second one, "Grant Administrator Privileged", which does go a step further.

    When I set up a new PC with Win-7, I immediately run one of the two scripts on every folder where I might be
    wanting to delete files, rename files, etc. It just makes life with Windows a lot easier.
    Then, I just never get those annoying messages that I don't have permission to do something, or that I need to
    consult with my IT MANAGER. I AM THE IT MANAGER. I'm also the owner, builder and only operator of this computer.

    Sorry, I didn't mean for this to become a rant. Apologies.

    The Doctor
    Experience is truly the best teacher.

    Backup! Backup! Backup! GHOST Rocks!

  12. #11
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    5,957
    Thanks
    193
    Thanked 730 Times in 666 Posts
    Doctor, Doctor ...

    Would you be kind enough to post the scripts or links to them.

    Thanks.
    May the Forces of good computing be with you!

    RG

    VBA Rules!

    My Systems: Desktop Specs
    Laptop Specs


  13. #12
    Lounge VIP bobprimak's Avatar
    Join Date
    Feb 2009
    Location
    Hinsdale, IL, USA
    Posts
    2,291
    Thanks
    138
    Thanked 112 Times in 96 Posts
    Also, DrWho, would you kindly remind folks of the Windows 7 Hidden Administrator Account, which is turned off by default in the Home Premium Version? I came across a Command Prompt script to enable it once a long time ago, but I can't seem to find the web reference now.

    Your "rant" actually comes off as very sound advice, as I read it. No apologies needed.

    Folks, the Hidden Administrator Account in Windows 7 is the ONLY Account with FULL Administrator privileges.
    -- Bob Primak --

  14. #13
    Plutonium Lounger Medico's Avatar
    Join Date
    Dec 2009
    Location
    USA
    Posts
    12,625
    Thanks
    161
    Thanked 928 Times in 851 Posts
    Bob, is this the method you mentioned from How To Geek?
    BACKUP...BACKUP...BACKUP
    Have a Great Day! Ted


    Sony Vaio Laptop, 2.53 GHz Duo Core Intel CPU, 8 GB RAM, 320 GB HD
    Win 8 Pro (64 Bit), IE 10 (64 Bit)


    Complete PC Specs: By Speccy

  15. The Following User Says Thank You to Medico For This Useful Post:

    bobprimak (2011-06-30)

  16. #14
    Lounge VIP bobprimak's Avatar
    Join Date
    Feb 2009
    Location
    Hinsdale, IL, USA
    Posts
    2,291
    Thanks
    138
    Thanked 112 Times in 96 Posts
    Quote Originally Posted by Ted Myers View Post
    Bob, is this the method you mentioned from How To Geek?
    Yes, as a matter of fact it is. I forgot to bookmark that, but thanks to your post, I have it in my Tech Bookmarks Folder on my Chrome Toolbar now (just in case I ever want to disable that Account).
    -- Bob Primak --

Posting Permissions

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