![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | RunOnce as Administrator in Vista Hi, I am trying to figure out how to run a vbScript in Vista that requires Administrators access and then reboot and continue with the script. In the past, I have used the runonce key in the registry to do this. However, in Vista, even though I log in as an administrator, the script does not run. Any ideas. I saw that this question was asked way back in 2007 but never answered. TIA, OldDog |
My System Specs![]() |
| | #2 (permalink) |
| | Re: RunOnce as Administrator in Vista "OldDog" <mikef2691@xxxxxx> wrote in message news:e2453f30-44c0-4371-ae59-64764bfdc8d8@xxxxxx Quote: > Hi, > > I am trying to figure out how to run a vbScript in Vista that requires > Administrators access and then reboot and continue with the script. > > In the past, I have used the runonce key in the registry to do this. > However, in Vista, even though I log in as an administrator, the > script does not run. > > Any ideas. I saw that this question was asked way back in 2007 but > never answered. > > > TIA, > > OldDog with Administrator privileges. However, in Vista being logged in as Administrator is not enough. You must use the "Run as administrator" feature when you launch the script. For example, you can right click a shortcut to cmd.exe and select "Run as administrator" and launch the VBScript program in the elevated command console. The person that logs on after the restart must be an administrator. You can right click a *.exe file and select "Run as administrator", but this option is not available for *.vbs files. I think you must right click either cmd.exe or a shortcut to cmd.exe to run a VBScript program with enough privileges to write to HKLM. If this doesn't work, you may need a manifest. -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
| | #3 (permalink) |
| | Re: RunOnce as Administrator in Vista Enter this code in the beginning of your script. If WScript.Arguments.Count = 0 Then Set ObjShell = CreateObject("Shell.Application") ObjShell.ShellExecute "wscript.exe", """" & _ WScript.ScriptFullName & """" & " RunAsAdmin", , "runas", 1 Else -- Windows XP and Vista Tweaks ------------------------------------------------------------ www.paulsxp.com ------------------------------------------------------------ Windows XP and Vista Help Forum ------------------------------------------------------------ www.paulsxp.com/forum ------------------------------------------------------------ Live Computer Help and Chat ------------------------------------------------------------ www.paulsxp.com/livesupport.html ------------------------------------------------------------ "OldDog" <mikef2691@xxxxxx> wrote in message news:e2453f30-44c0-4371-ae59-64764bfdc8d8@xxxxxx Quote: > Hi, > > I am trying to figure out how to run a vbScript in Vista that requires > Administrators access and then reboot and continue with the script. > > In the past, I have used the runonce key in the registry to do this. > However, in Vista, even though I log in as an administrator, the > script does not run. > > Any ideas. I saw that this question was asked way back in 2007 but > never answered. > > > TIA, > > OldDog |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| RunOnce tasks in Vista must be completed before desktop is available? | General Discussion | |||
| Set-ExecutionPolicy in RunOnce doesn't work | PowerShell | |||
| setting batchfile to runonce prior to user logon (winxp sp2) | PowerShell | |||
| Invoking PS script in RunOnce | PowerShell | |||
| IE 7 Runonce Operation Aborted and other errors. | Vista General | |||