Results 1 to 5 of 5

Thread: Run As Administrator from vbScript

  1. #1
    Santiago Bruni Guest

    Run As Administrator from vbScript

    I want to use the "Run As Administrator" functionality of Windows Vista
    (UAC), from a vbScript to call any application.
    It is possible?

    Thanks.

  2. #2
    Ramesh, MS-MVP Guest
    Yes. Here is a sample script!

    - - -
    Set objSh = CreateObject("Shell.Application")
    objSh.ShellExecute "notepad.exe", "" , "", "runas", 1
    - - -
    It is possible to pass through the same function User and Password of
    Administrator to execute this application?

    Nope. I don't think it's possible, especially in the UAC dialog. Perhaps you can repost this question in WSH groups for any alternate solutions.

  3. #3
    DevilsPGD Guest

    Re: Run As Administrator from vbScript

    Are you trying to bypass the UAC prompt, or run an application with
    administrative privileges after a UAC prompt?

    If you can handle waiting a minute or two, you can have a scheduled task
    that launches a script to look for an external trigger (existence of a
    temporary file would be the easiest) that kicks off the elevated
    process.

    If you wanted something more real-time and don't need to interact with
    the desktop, you could write a service to accomplish your goal.

  4. #4
    Join Date
    Sep 2010
    Posts
    1

    Re: Run As Administrator from vbScript

    I have to do same work for WIN-XP also along with win-7 and vista.
    How can I run single script for these OS, or I will have to write different for XP and for vista & 7, if yes then how in xp?

  5. #5
    Join Date
    Apr 2009
    Posts
    488

    Re: Run As Administrator from vbScript

    I am not sure about all the ways that might you help in this. For that run command prompt and then in that use the Runas command. The normal way of a command looks like RunAs /user:YourDomain\Administrator CScript YourVbsFiel.vbs. Once you execute the command it will as for a password to run the vbs script as Administrator.

Similar Threads

  1. VBScript for .NET
    By Bharat89 in forum Software Development
    Replies: 3
    Last Post: 03-12-2009, 04:50 PM
  2. About VBScript Editing
    By Modifier in forum Software Development
    Replies: 2
    Last Post: 02-09-2009, 05:34 PM
  3. help with vbscript
    By andrakis2 in forum Networking & Security
    Replies: 3
    Last Post: 24-08-2009, 06:13 AM
  4. How can I add a new line to vbscript?
    By Baani in forum Software Development
    Replies: 2
    Last Post: 29-05-2009, 04:54 PM
  5. Replies: 2
    Last Post: 15-05-2008, 11:17 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,115,339.97775 seconds with 17 queries