1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

How to make VBscript "Run As Administrator" automatically.

Discussion in 'Software Development' started by pure_evil020, Nov 3, 2011.

Thread Status:
Not open for further replies.
  1. pure_evil020

    pure_evil020 Thread Starter

    Jul 31, 2008
    Hi there,
    I have a program that executes a vbscript to perform certain tasks, but it does not work properly without being "Run As Administrator" on a windows 7 OS.
    Its fine with windows XP OS, but windows 7 insists on being run as administrator, otherwise it denies access to the TEMP folder, when the program attempts to write and execute a script.

    My solution (if such a script is possible) would be to make another pre-packed VBscript, or Reg file, included with the program executable, then have the program recognize when the user launches the program for the first time, check if the user is running windows 7, then if this returns true, pop up a message to tell the user that windows 7 requires the program to be "Run As Administrator", and ask the user if they would like the program to automatically "Run As Administrator" in the future.

    If the user agrees, the program would run this pre-packed VBscript (Or Reg file) to make the exe always run as administrator (If this is possible)...

    I'm hoping there is some kind of registry entry that can be modified, to allow an EXE to always be launched with administrative privileges.

    If you're asking "Why don't you just pre-pack all of the scripts then?", this is because the scripts are "User Defined", meaning the user defines certain parameters for the script, then the program writes the script, based on what the user wanted done, and launches that script.
    Therefore, even if I Pre-packed the scripts, the program would still need to access and edit the script files, to make the script do whatever the user wants (which windows 7 will not allow without the program being run as administrator).

    So is there such a script (VB, or Reg) that could permanently give a program exe Administrative privileges? :confused:
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1025256

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice