Running VB Script with admin rights

Discussion in 'NZ Computing' started by John, Sep 22, 2004.

  1. John

    John Guest

    Hi
    I've done it before but forgotten....
    I have a vb script that backs up work to tape then shuts down XP,
    allows you to walk away after completing yoru work...

    My wife doesnt have admin rights hence xp wont shut down.
    I need to pass admin rights when I execute the shutdown:

    sYes = MsgBox (msg, 4, "Do you want windows to shutdown after the
    backup?")

    oWsh.run "cmd.exe /c "& sJob,1,TRUE

    or have the script run itself with admin rights

    Idears?

    Cheers
    John
    John, Sep 22, 2004
    #1
    1. Advertising

  2. John

    Bok Guest

    John wrote:
    > Hi
    > I've done it before but forgotten....
    > I have a vb script that backs up work to tape then shuts down XP,
    > allows you to walk away after completing yoru work...
    >
    > My wife doesnt have admin rights hence xp wont shut down.
    > I need to pass admin rights when I execute the shutdown:
    >
    > sYes = MsgBox (msg, 4, "Do you want windows to shutdown after the
    > backup?")
    >
    > oWsh.run "cmd.exe /c "& sJob,1,TRUE
    >
    > or have the script run itself with admin rights


    Use the group policy or local policy editor to enable the "Shut down the
    system" right for her account or the group she is a member of.

    If you drill down to the appropriate policy you just double click and
    add the user or group.
    Bok, Sep 22, 2004
    #2
    1. Advertising

  3. John

    T-Boy Guest

    In article <>, lid says...
    > John wrote:
    > > Hi
    > > I've done it before but forgotten....
    > > I have a vb script that backs up work to tape then shuts down XP,
    > > allows you to walk away after completing yoru work...
    > >
    > > My wife doesnt have admin rights hence xp wont shut down.
    > > I need to pass admin rights when I execute the shutdown:
    > >
    > > sYes = MsgBox (msg, 4, "Do you want windows to shutdown after the
    > > backup?")
    > >
    > > oWsh.run "cmd.exe /c "& sJob,1,TRUE
    > >
    > > or have the script run itself with admin rights

    >
    > Use the group policy or local policy editor to enable the "Shut down the
    > system" right for her account or the group she is a member of.
    >
    > If you drill down to the appropriate policy you just double click and
    > add the user or group.


    Another way might (never tried it out) is to use the 'runas' command.
    This would (?) still provide for the wife not having the shutdown
    capability herself (which might be desired :)

    --
    Duncan
    T-Boy, Sep 22, 2004
    #3
  4. John

    Bob Guest

    Automating RunAs in a script was intentionally made difficult by MS
    when they designed the feature. It may well be overkill for a home
    network solution, but I've used the Script Packager feature of the
    Admin Script Editor to do this before. It lets you package your script
    into an executable with the option of providing alternate credentials
    for it to run under (like RunAs). You can check it out at
    http://www.adminscripteditor.com

    T-Boy <> wrote in message news:<>...
    > In article <>, lid says...
    > > John wrote:
    > > > Hi
    > > > I've done it before but forgotten....
    > > > I have a vb script that backs up work to tape then shuts down XP,
    > > > allows you to walk away after completing yoru work...
    > > >
    > > > My wife doesnt have admin rights hence xp wont shut down.
    > > > I need to pass admin rights when I execute the shutdown:
    > > >
    > > > sYes = MsgBox (msg, 4, "Do you want windows to shutdown after the
    > > > backup?")
    > > >
    > > > oWsh.run "cmd.exe /c "& sJob,1,TRUE
    > > >
    > > > or have the script run itself with admin rights

    > >
    > > Use the group policy or local policy editor to enable the "Shut down the
    > > system" right for her account or the group she is a member of.
    > >
    > > If you drill down to the appropriate policy you just double click and
    > > add the user or group.

    >
    > Another way might (never tried it out) is to use the 'runas' command.
    > This would (?) still provide for the wife not having the shutdown
    > capability herself (which might be desired :)
    Bob, Sep 22, 2004
    #4
  5. John

    John Guest

    On Wed, 22 Sep 2004 21:35:14 +1200, Bok <> wrote:


    >If you drill down to the appropriate policy you just double click and
    >add the user or group.

    Have given power user rights, still not enough, next is administrator
    which I wish to avoid...
    John, Sep 22, 2004
    #5
  6. John

    Tim Guest

    Why not create a scheduled task?

    You can configure it to run how you want - you can configure it to run in
    the context of an account with whatever rights are needed. Don't forget to
    re-specify the account password for such a task when you change the
    password...


    - Tim




    "Bob" <> wrote in message
    news:...
    > Automating RunAs in a script was intentionally made difficult by MS
    > when they designed the feature. It may well be overkill for a home
    > network solution, but I've used the Script Packager feature of the
    > Admin Script Editor to do this before. It lets you package your script
    > into an executable with the option of providing alternate credentials
    > for it to run under (like RunAs). You can check it out at
    > http://www.adminscripteditor.com
    >
    > T-Boy <> wrote in message
    > news:<>...
    >> In article <>, lid says...
    >> > John wrote:
    >> > > Hi
    >> > > I've done it before but forgotten....
    >> > > I have a vb script that backs up work to tape then shuts down XP,
    >> > > allows you to walk away after completing yoru work...
    >> > >
    >> > > My wife doesnt have admin rights hence xp wont shut down.
    >> > > I need to pass admin rights when I execute the shutdown:
    >> > >
    >> > > sYes = MsgBox (msg, 4, "Do you want windows to shutdown after the
    >> > > backup?")
    >> > >
    >> > > oWsh.run "cmd.exe /c "& sJob,1,TRUE
    >> > >
    >> > > or have the script run itself with admin rights
    >> >
    >> > Use the group policy or local policy editor to enable the "Shut down
    >> > the
    >> > system" right for her account or the group she is a member of.
    >> >
    >> > If you drill down to the appropriate policy you just double click and
    >> > add the user or group.

    >>
    >> Another way might (never tried it out) is to use the 'runas' command.
    >> This would (?) still provide for the wife not having the shutdown
    >> capability herself (which might be desired :)
    Tim, Sep 23, 2004
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Phil

    Re: Admin rights

    Phil, Jul 5, 2003, in forum: Computer Support
    Replies:
    1
    Views:
    601
    Brian H¹©
    Jul 5, 2003
  2. Meat-->Plow

    Re: Admin rights

    Meat-->Plow, Jul 5, 2003, in forum: Computer Support
    Replies:
    1
    Views:
    493
    Brian H¹©
    Jul 5, 2003
  3. Fish

    XP Admin rights within Outlook ??

    Fish, Aug 9, 2003, in forum: Computer Support
    Replies:
    3
    Views:
    2,402
  4. Todd Baggarly

    Kodak EasyShare system w/out Admin rights

    Todd Baggarly, Nov 15, 2003, in forum: Digital Photography
    Replies:
    1
    Views:
    3,019
    William Jackson
    Nov 15, 2003
  5. =?Utf-8?B?VG9kZA==?=

    Admin rights for Users to setup WiFi connections

    =?Utf-8?B?VG9kZA==?=, Feb 4, 2007, in forum: Wireless Networking
    Replies:
    1
    Views:
    526
    =?Utf-8?B?UGF2ZWwgQS4=?=
    Feb 4, 2007
Loading...

Share This Page