We’d like to remind Forumites to please avoid political debate on the Forum.

This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.

📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!

How do you run a .vbs or .bat as adminstrator in Windows 8?

LucianH
LucianH Posts: 445 Forumite
Part of the Furniture 100 Posts Name Dropper Photogenic
edited 13 February 2013 at 8:53PM in Techie Stuff
I really am trying to get the hang of Windows 8 Pro but it's begining to get on my ti..

I have some batch files and vbscript files that were running under Vista but seem to refuse to run under windows 8 which I assume are due to security restrictions.

I've got a simple example of a batch file to disable hibernation (containing a single line of "powercfg -h off") but double clicking on the .bat file doesn't work. I've tried creating a shortcut but can't set the "run as administrator" option since it's greyed out.

I'm working on a laptop with a single account set as administrator (and no password).

Any ideas?
Never let it get you down... unless it really is as bad as it seems.

Comments

  • LucianH wrote: »
    I really am trying to get the hang of Windows 8 Pro but it's begining to get on my ti..

    I have some batch files and vbscript files that were running under Vista but seem to refuse to run under windows 8 which I assume are due to security restrictions.

    I've got a simple example of a batch file to disable hibernation (containing a single line of "powercfg -h off") but double clicking on the .bat file doesn't work. I've tried creating a shortcut but can't set the "run as administrator" option since it's greyed out.

    I'm working on a laptop with a single account set as administrator (and no password).

    Any ideas?
    Create a shortcut on Desktop(right click on desktop space) eg New ---> Shortcut then enter shutdown.exe /h .... then next and call it hibernate ... then finish.... Now right click on the shortcut and pin to start / or task bar.
    4.8kWp 12x400W Longhi 9.6 kWh battery Giv-hy 5.0 Inverter, WSW facing Essex . Aint no sunshine ☀️ Octopus gas fixed dec 24 @ 5.74 tracker again+ Octopus Intelligent Flux leccy
  • debitcardmayhem
    debitcardmayhem Posts: 12,981 Forumite
    Part of the Furniture 10,000 Posts Name Dropper Photogenic
    edited 12 February 2013 at 10:57PM
    Also if you want to run a .bat file from "Start" then go to the search bit (top/bottom) right of screen, then type in File Explorer, find the file (works the same if you use Windows Explorer apparently) then right click pin to Start ....(I believe you can also set it to run as Admin too from properties but I am not sure since OH is using my W8 at the mo ...but that I believe that brings up the Allow to Make Changes pop up)
    4.8kWp 12x400W Longhi 9.6 kWh battery Giv-hy 5.0 Inverter, WSW facing Essex . Aint no sunshine ☀️ Octopus gas fixed dec 24 @ 5.74 tracker again+ Octopus Intelligent Flux leccy
  • LucianH
    LucianH Posts: 445 Forumite
    Part of the Furniture 100 Posts Name Dropper Photogenic
    I've been cheeky and changed the title of the thread (to reflect my real problem which is running scripts in administrator mode). (For info, the thread title was "How do you run batch files in Windows 8")

    Since posting, I've noticed that when you create a shortcut to a batch file you can go to the advanced tab on properties and change select "run as administrator". However, when I create a shortcut to a vbscript file, the "run as administrator" option is greyed out.

    Will keep playing but if anybody's got any suggestions it would help.

    Thanks.
    Never let it get you down... unless it really is as bad as it seems.
  • Jemma-T
    Jemma-T Posts: 1,546 Forumite
    Make sure UAC is set to NOT annoy you too.
  • RobTang
    RobTang Posts: 1,064 Forumite
    On my Win 8 machine you can right click the bat files and select run as admin.

    .vbs is a different problem, you can add some code the script which basically just re-runs the same script as admin or I think you can make a batch file that calls wscript / cscript with your script, then run the batch as admin.
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 351.7K Banking & Borrowing
  • 253.4K Reduce Debt & Boost Income
  • 454K Spending & Discounts
  • 244.7K Work, Benefits & Business
  • 600.2K Mortgages, Homes & Bills
  • 177.3K Life & Family
  • 258.4K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16.2K Discuss & Feedback
  • 37.6K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.